stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tycho Andersen <tycho@tycho.ws>
To: Christian Brauner <christian.brauner@canonical.com>
Cc: Kees Cook <keescook@chromium.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	stable@vger.kernel.org
Subject: Re: [PATCH 2/2] seccomp: disallow NEW_LISTENER and TSYNC flags
Date: Wed, 6 Mar 2019 14:30:00 -0700	[thread overview]
Message-ID: <20190306213000.GI7413@cisco> (raw)
In-Reply-To: <CAPP7u0Wp6q=LwtnbNk3YNaKKHXAfDqXd0Dx6xXXesvKpR-p+Gg@mail.gmail.com>

On Wed, Mar 06, 2019 at 10:02:25PM +0100, Christian Brauner wrote:
> On Wed, Mar 6, 2019 at 9:46 PM Tycho Andersen <tycho@tycho.ws> wrote:
> >
> > On Wed, Mar 06, 2019 at 09:39:35PM +0100, Christian Brauner wrote:
> > > > +
> > > >     /* Prepare the new filter before holding any locks. */
> > > >     prepared = seccomp_prepare_user_filter(filter);
> > > >     if (IS_ERR(prepared))
> > > > @@ -1302,7 +1315,7 @@ static long seccomp_set_mode_filter(unsigned int flags,
> > > >             mutex_unlock(&current->signal->cred_guard_mutex);
> > > >  out_put_fd:
> > > >     if (flags & SECCOMP_FILTER_FLAG_NEW_LISTENER) {
> > > > -           if (ret < 0) {
> > > > +           if (ret) {
> > >
> > > Why that change but keep checking if (ret < 0) further up?
> >
> > Not sure what you mean here. The only other place I see that we check
> > something is < 0 in that function is the return value of
> > get_unused_fd_flags(), which looks right to me?
> 
> The change just seemed it had nothing to do with the rest of the patch.
> Just making sure this didn't happen on accident and would cause regressions.

No, not on accident :). See the second half of the patch notes.

I can split it out into two separate patches if that makes more sense.
In fact this hunk alone fixes the UAF, but you still get non-sensical
return results even if it doesn't do anything terrible, hence the
first hunk.

Cheers,

Tycho

  reply	other threads:[~2019-03-06 21:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190306201413.14153-1-tycho@tycho.ws>
2019-03-06 20:14 ` [PATCH 2/2] seccomp: disallow NEW_LISTENER and TSYNC flags Tycho Andersen
2019-03-06 20:39   ` Christian Brauner
2019-03-06 20:46     ` Tycho Andersen
2019-03-06 21:02       ` Christian Brauner
2019-03-06 21:30         ` Tycho Andersen [this message]
2019-04-23 22:09   ` Kees Cook
2019-04-23 23:18     ` James Morris
2019-04-23 23:31     ` Kees Cook
2019-04-23 23:34       ` Tycho Andersen
2019-04-24  1:02         ` Kees Cook

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=20190306213000.GI7413@cisco \
    --to=tycho@tycho.ws \
    --cc=christian.brauner@canonical.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /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).