From: Kees Cook <keescook@chromium.org>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
Eric Biggers <ebiggers3@gmail.com>,
Dmitry Vyukov <dvyukov@google.com>,
syzbot
<bot+e93a80c1bb7c5c56e522461c149f8bf55eab1b2b@syzkaller.appspotmail.com>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
syzkaller-bugs <syzkaller-bugs@googlegroups.com>
Subject: Re: [PATCH] fs: Allow opening only regular files during execve().
Date: Tue, 22 Jan 2019 13:51:20 +1300 [thread overview]
Message-ID: <CAGXu5jKYW46a-ZJF1YDN31FMiMpnsinbVReMrygYV0a2jo815Q@mail.gmail.com> (raw)
In-Reply-To: <20190121211800.GC2217@ZenIV.linux.org.uk>
On Tue, Jan 22, 2019 at 10:18 AM Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> On Mon, Jan 21, 2019 at 07:14:39PM +0900, Tetsuo Handa wrote:
> > On Tue, Dec 12, 2017 at 2:06 PM, Eric Biggers <ebiggers3@gmail.com> wrote:
> > > I'm not sure what the fix will be. Maybe the proc handlers should take a
> > > different lock instead of cred_guard_mutex. Or perhaps execve should check that
> > > the file is a regular file before it attempts to open it.
> >
> > We can easily distinguish open() from execve() and open() from others. ;-)
>
> > + /* The file or a script interpreter has to be a regular file. */
> > + if (unlikely(current->in_execve && !S_ISREG(inode->i_mode))) {
> > + error = -EACCES;
> > + goto cleanup_file;
> > + }
>
> We are *NOT* going to use current->in_execve to propagate that information.
> Come up with a cleaner solution, if you care, but this one is a non-starter.
> Too ugly to live. Sorry.
What would you suggest for a cleaner indication of being in an execve?
--
Kees Cook
prev parent reply other threads:[~2019-01-22 0:51 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <001a113f711ae2110c055f45acb8@google.com>
2017-12-02 8:12 ` possible deadlock in seq_read syzbot
2017-12-03 22:02 ` syzbot
2017-12-12 22:06 ` Eric Biggers
2017-12-27 18:30 ` Dmitry Vyukov
2018-08-27 18:20 ` Kees Cook
2018-08-27 20:57 ` Dmitry Vyukov
2019-01-21 10:14 ` [PATCH] fs: Allow opening only regular files during execve() Tetsuo Handa
2019-01-21 20:24 ` Kees Cook
2019-01-21 21:18 ` Al Viro
2019-01-22 0:50 ` [PATCH v2] " Tetsuo Handa
2019-01-28 23:42 ` Andrew Morton
2019-02-12 2:01 ` Tetsuo Handa
2019-02-12 5:26 ` Tetsuo Handa
2019-02-19 9:51 ` Tetsuo Handa
2019-01-22 0:51 ` Kees Cook [this message]
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=CAGXu5jKYW46a-ZJF1YDN31FMiMpnsinbVReMrygYV0a2jo815Q@mail.gmail.com \
--to=keescook@chromium.org \
--cc=bot+e93a80c1bb7c5c56e522461c149f8bf55eab1b2b@syzkaller.appspotmail.com \
--cc=dvyukov@google.com \
--cc=ebiggers3@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=penguin-kernel@i-love.sakura.ne.jp \
--cc=syzkaller-bugs@googlegroups.com \
--cc=viro@zeniv.linux.org.uk \
/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).