Messages in this thread | | | From | Mark Salyzyn <> | Date | Fri, 27 Jul 2018 11:41:05 -0700 | Subject | Re: [PATCH] tracing: do not leak kernel addresses |
| |
<div dir="ltr">Any system can chose to change the permissions of a sysfs node, default, DAC (and MAC) is just layers of multi-level security (or lack thereof). As well intentioned as a default DAC is in the kernel, leaking kernel addresses is still an attack surface that we want to close tightly.<div><br></div><div>For instance on Android:</div><div><br></div><div> chmod 0755 /sys/kernel/debug/tracing</div><div><br></div><div>is in the common init.rc file ...</div><div><div><br></div><div>If DAC has been adjusted at runtime to permit access to the node, I would think that if the caller does not have all the credentials/capabilities, we do want the addresses to be abstracted by the kernel.</div></div><div><br></div><div>-- Mark</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 27, 2018 at 11:31 AM, Steven Rostedt <span dir="ltr"><<a href="mailto:rostedt@goodmis.org" target="_blank">rostedt@goodmis.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fri, 27 Jul 2018 11:13:51 -0700<br> Nick Desaulniers <<a href="mailto:ndesaulniers@google.com">ndesaulniers@google.com</a>> wrote:<br> <br> > I found the internal bug report (reported Jan '17, you'll have to<br> > forgive me if my memory of the issue is hazy, or if the fix used at<br> > the time wasn't perfect), which was reported against the Nexus 6.<br> > >From the report, it was possible to `cat <br> > /sys/kernel/debug/tracing/<wbr>printk_formats` without being root, which I<br> > can't do on my workstations much more modern kernel (Nexus 6 was<br> > 3.10). So I guess the question is what governs access to files below<br> > /sys/kernel/debug, and why was it missing from those kernels? I<br> > assume some check was added, but either not backported to 3.10 stable<br> > (or more likely not pulled in to Nexus 6's kernel through stable;<br> > Android is now in a much better place for that kind of issue).<br> <br> </span>As of commit 82aceae4f0d4 ("debugfs: more tightly restrict default<br> mount mode") /sys/kernel/debug has been default mounted as 0700 (root<br> only). But that was introduced in 3.7. Not sure why your 3.10 kernel<br> didn't have that. Perhaps there's another commit that fixed<br> permissions not being inherited?<br> <br> -- Steve<br> <div class="HOEnZb"><div class="h5"><br> -- <br> You received this message because you are subscribed to the Google Groups "kernel-team" group.<br> To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:kernel-team%2Bunsubscribe@android.com">kernel-team+unsubscribe@<wbr>android.com</a>.<br> <br> </div></div></blockquote></div><br></div>
| |