[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=whLBq63v_h71YuBM2aNjCSBprkBEO3fevbWnkp8TDeh5g@mail.gmail.com>
Date: Mon, 14 Jun 2021 11:02:46 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Kees Cook <keescook@...omium.org>
Cc: youling257 <youling257@...il.com>,
Christian Brauner <christian.brauner@...ntu.com>,
Andrea Righi <andrea.righi@...onical.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
stable <stable@...r.kernel.org>, regressions@...ts.linux.dev,
LSM List <linux-security-module@...r.kernel.org>,
Paul Moore <paul@...l-moore.com>,
Stephen Smalley <stephen.smalley.work@...il.com>,
SElinux list <selinux@...r.kernel.org>
Subject: Re: [PATCH] proc: Track /proc/$pid/attr/ opener mm_struct
On Mon, Jun 14, 2021 at 9:45 AM Kees Cook <keescook@...omium.org> wrote:
>
> /* 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
Powered by blists - more mailing lists