From: Kees Cook <keescook@chromium.org>
To: Rodrigo Campos <rodrigo@kinvolk.io>
Cc: "Sargun Dhillon" <sargun@sargun.me>,
LKML <linux-kernel@vger.kernel.org>,
containers@lists.linux.dev, "Tycho Andersen" <tycho@tycho.pizza>,
"Andy Lutomirski" <luto@kernel.org>,
"Mauricio Vásquez Bernal" <mauricio@kinvolk.io>,
"Giuseppe Scrivano" <gscrivan@redhat.com>,
"Christian Brauner" <christian.brauner@ubuntu.com>,
"Mickaël Salaün" <mic@linux.microsoft.com>
Subject: Re: [PATCH v2 2/4] seccomp: Refactor notification handler to prepare for new semantics
Date: Thu, 27 May 2021 11:41:58 -0700 [thread overview]
Message-ID: <202105271137.C491991621@keescook> (raw)
In-Reply-To: <CACaBj2YUiowSKzvh02OjpQNqQViA8N0eyRMimkK=90NagRF40w@mail.gmail.com>
On Thu, May 27, 2021 at 01:51:13PM +0200, Rodrigo Campos wrote:
> On Mon, May 17, 2021 at 9:39 PM Sargun Dhillon <sargun@sargun.me> wrote:
> >
> > This refactors the user notification code to have a do / while loop around
> > the completion condition. This has a small change in semantic, in that
> > previously we ignored addfd calls upon wakeup if the notification had been
> > responded to, but instead with the new change we check for an outstanding
> > addfd calls prior to returning to userspace.
> >
> > Rodrigo Campos also identified a bug that can result in addfd causing
> > an early return, when the supervisor didn't actually handle the
> > syscall [1].
> >
> > [1]: https://lore.kernel.org/lkml/20210413160151.3301-1-rodrigo@kinvolk.io/
> >
> > Fixes: 7cf97b125455 ("seccomp: Introduce addfd ioctl to seccomp user notifier")
> > Signed-off-by: Sargun Dhillon <sargun@sargun.me>
> > Acked-by: Tycho Andersen <tycho@tycho.pizza>
>
> Kees, as I mentioned in the linked thread, this issue is present in
> 5.9+ kernels. Should we add the cc to stable for this patch? Or should
> we cc to stable the one linked, that just fixes the issue without
> semantic changes to userspace?
It sounds like the problem is with Go, using addfd, on 5.9-5.13 kernels,
yes? Would the semantic change be a problem there? (i.e. it sounds like
the semantic change was fine for the 5.14+ kernels, so I'm assuming it's
fine for earlier ones too.)
> Just to be clear, the other patch that fixes the problem without
> userspace visible changes is this:
> https://lore.kernel.org/lkml/20210413160151.3301-1-rodrigo@kinvolk.io/
I'd prefer to use the now-in-next fix if we can. Is it possible to build
a test case that triggers the race so we can have some certainty that
any fix in -stable covers it appropriately?
-Kees
--
Kees Cook
next prev parent reply other threads:[~2021-05-27 18:42 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-17 19:39 [PATCH v2 0/4] Atomic addfd send and reply Sargun Dhillon
2021-05-17 19:39 ` [PATCH v2 1/4] Documentation: seccomp: Fix user notification documentation Sargun Dhillon
2021-05-17 19:39 ` [PATCH v2 2/4] seccomp: Refactor notification handler to prepare for new semantics Sargun Dhillon
2021-05-25 16:03 ` Rodrigo Campos
2021-05-25 20:44 ` Sargun Dhillon
2021-05-27 11:51 ` Rodrigo Campos
2021-05-27 18:41 ` Kees Cook [this message]
2021-05-28 15:27 ` Rodrigo Campos
2021-05-28 16:50 ` Kees Cook
2021-05-28 17:14 ` Kees Cook
2021-05-28 22:31 ` Rodrigo Campos
2021-06-01 19:22 ` Kees Cook
2021-05-17 19:39 ` [PATCH v2 3/4] seccomp: Support atomic "addfd + send reply" Sargun Dhillon
2021-05-21 15:45 ` Christian Brauner
2021-05-17 19:39 ` [PATCH v2 4/4] selftests/seccomp: Add test for atomic addfd+send Sargun Dhillon
2021-05-18 16:45 ` [PATCH v2 0/4] Atomic addfd send and reply Andy Lutomirski
2021-05-21 15:44 ` Christian Brauner
2021-05-27 2:43 ` 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=202105271137.C491991621@keescook \
--to=keescook@chromium.org \
--cc=christian.brauner@ubuntu.com \
--cc=containers@lists.linux.dev \
--cc=gscrivan@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mauricio@kinvolk.io \
--cc=mic@linux.microsoft.com \
--cc=rodrigo@kinvolk.io \
--cc=sargun@sargun.me \
--cc=tycho@tycho.pizza \
/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