From: Linus Torvalds <torvalds@linux-foundation.org>
To: Kees Cook <keescook@chromium.org>
Cc: youling257 <youling257@gmail.com>,
Christian Brauner <christian.brauner@ubuntu.com>,
Andrea Righi <andrea.righi@canonical.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
stable <stable@vger.kernel.org>,
regressions@lists.linux.dev,
LSM List <linux-security-module@vger.kernel.org>,
Paul Moore <paul@paul-moore.com>,
Stephen Smalley <stephen.smalley.work@gmail.com>,
SElinux list <selinux@vger.kernel.org>
Subject: Re: [PATCH] proc: Track /proc/$pid/attr/ opener mm_struct
Date: Mon, 14 Jun 2021 11:02:46 -0700 [thread overview]
Message-ID: <CAHk-=whLBq63v_h71YuBM2aNjCSBprkBEO3fevbWnkp8TDeh5g@mail.gmail.com> (raw)
In-Reply-To: <202106140941.7CE5AE64@keescook>
On Mon, Jun 14, 2021 at 9:45 AM Kees Cook <keescook@chromium.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
next prev parent reply other threads:[~2021-06-14 18:03 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-08 17:12 [PATCH] proc: Track /proc/$pid/attr/ opener mm_struct Kees Cook
2021-06-09 6:40 ` Christian Brauner
2021-06-14 10:02 ` youling257
2021-06-14 15:32 ` Kees Cook
2021-06-14 16:45 ` Kees Cook
2021-06-14 18:02 ` Linus Torvalds [this message]
2021-06-14 18:46 ` youling 257
2021-06-14 22:50 ` Kees Cook
2021-06-15 1:55 ` youling 257
2021-06-15 18:19 ` Linus Torvalds
2021-06-15 21:50 ` Kees Cook
2021-06-16 5:56 ` Greg KH
2021-06-16 5:15 ` youling 257
2021-06-14 17:52 ` Casey Schaufler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAHk-=whLBq63v_h71YuBM2aNjCSBprkBEO3fevbWnkp8TDeh5g@mail.gmail.com' \
--to=torvalds@linux-foundation.org \
--cc=andrea.righi@canonical.com \
--cc=christian.brauner@ubuntu.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=paul@paul-moore.com \
--cc=regressions@lists.linux.dev \
--cc=selinux@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=stephen.smalley.work@gmail.com \
--cc=youling257@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).