Re: [PATCH] proc: Track /proc/$pid/attr/ opener mm_struct

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
2021-06-14 18:04:07
Also in
lkml, regressions, selinux, stable
Reply to
Kees Cook, 2021-06-14
On Mon, Jun 14, 2021 at 9:45 AM Kees Cook [off-list ref] wrote:
quoted hunk ↗ jump to hunk

        /* A task may only write when it was the opener. */
-       if (file->private_data != current->mm)
+       if (!file->private_data || file->private_data != current->mm)
I don't think this is necessary.

If file->private_data is NULL, then the old test for private_data !=
current->mm will still work just fine.

Because if you can fool kernel threads to do the write for you, you
have bigger security issues than that test.

               Linus
Thread (4 messages) 4 messages, 3 authors, last reply 2021-06-14
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help