[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXu5jKYW46a-ZJF1YDN31FMiMpnsinbVReMrygYV0a2jo815Q@mail.gmail.com>
Date: Tue, 22 Jan 2019 13:51:20 +1300
From: Kees Cook <keescook@...omium.org>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>,
Eric Biggers <ebiggers3@...il.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
syzbot
<bot+e93a80c1bb7c5c56e522461c149f8bf55eab1b2b@...kaller.appspotmail.com>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
syzkaller-bugs <syzkaller-bugs@...glegroups.com>
Subject: Re: [PATCH] fs: Allow opening only regular files during execve().
On Tue, Jan 22, 2019 at 10:18 AM Al Viro <viro@...iv.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@...il.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
Powered by blists - more mailing lists