Linux Documentation
 help / color / mirror / Atom feed
From: Aleksa Sarai <cyphar@cyphar.com>
To: Andrei Vagin <avagin@gmail.com>
Cc: "Alexander Mikhalitsyn" <aleksandr.mikhalitsyn@canonical.com>,
	kees@kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, bpf@vger.kernel.org,
	"Andy Lutomirski" <luto@amacapital.net>,
	"Will Drewry" <wad@chromium.org>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Shuah Khan" <shuah@kernel.org>,
	"Tycho Andersen" <tycho@tycho.pizza>,
	"Christian Brauner" <brauner@kernel.org>,
	"Stéphane Graber" <stgraber@stgraber.org>,
	"Alexander Mikhalitsyn" <alexander@mihalicyn.com>
Subject: Re: [PATCH v3 6/7] seccomp: allow nested listeners
Date: Wed, 21 Jan 2026 16:43:29 +0100	[thread overview]
Message-ID: <2026-01-21-tame-yapping-name-paste-hnBZQp@cyphar.com> (raw)
In-Reply-To: <CANaxB-z8+UhZ+smuocN8h+YZY9tdKobhAu3H6fmzq+WzFmMrjg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2039 bytes --]

On 2026-01-20, Andrei Vagin <avagin@gmail.com> wrote:
> On Thu, Dec 11, 2025 at 4:46 AM Alexander Mikhalitsyn
> <aleksandr.mikhalitsyn@canonical.com> wrote:
> >
> > Now everything is ready to get rid of "only one listener per tree"
> > limitation.
> >
> > Let's introduce a new uAPI flag
> > SECCOMP_FILTER_FLAG_ALLOW_NESTED_LISTENERS, so userspace may explicitly
> > allow nested listeners when installing a listener.
> 
> I am not sure we really need SECCOMP_FILTER_FLAG_ALLOW_NESTED_LISTENERS.
> If nested listeners are completely functional, why would we want to
> implicitly allow or disallow someone from using them?

It can be quite easy to deadlock a process using seccomp-notify (even
in the single-notifier case) so especially in the case of container
managers I can see the argument for wanting this to be an opt-in thing
once container runtimes have verified their notifier won't break
nesting.

Then again, you can also use seccomp to block
SECCOMP_FILTER_FLAG_NEW_LISTENER directly, so you don't really need a
separate flag to allow nested listeners (unless I'm missing something)?
That would make it opt-out but presumably filters that allow seccomp
already use an allow-list for flags.

> Actually, even the current behavior of SECCOMP_RET_USER_NOTIF looks a
> bit illogical. I think the following behavior would be more expected:
> instead of running all filters and picking the most restrictive result,
> the kernel should execute them one by one (most recent fist). If a filter
> returns USER_NOTIF, the kernel pauses immediately to let the listener
> handle the call. If that listener then issues "CONTINUE", the kernel
> resumes by running the remaining older filters in the chain.

I guess there is a philosophical argument that earlier filters are "more
trusted" but the seccomp security model has always been that the
strictest filter return wins and I don't really see a strong argument
for deviating from that for USER_NOTIF.

-- 
Aleksa Sarai
https://www.cyphar.com/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 265 bytes --]

  reply	other threads:[~2026-01-21 15:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-11 12:46 [PATCH v3 0/7] seccomp: support nested listeners Alexander Mikhalitsyn
2025-12-11 12:46 ` [PATCH v3 1/7] seccomp: remove unused argument from seccomp_do_user_notification Alexander Mikhalitsyn
2025-12-11 12:46 ` [PATCH v3 4/7] seccomp: mark first listener in the tree Alexander Mikhalitsyn
2026-01-21 12:22   ` Aleksa Sarai
2026-01-28 19:05     ` Alexander Mikhalitsyn
2026-01-28 22:32       ` Kees Cook
2025-12-11 12:46 ` [PATCH v3 6/7] seccomp: allow nested listeners Alexander Mikhalitsyn
2025-12-12 13:57   ` Andy Lutomirski
2026-01-28 19:10     ` Alexander Mikhalitsyn
2026-01-21  7:51   ` Andrei Vagin
2026-01-21 15:43     ` Aleksa Sarai [this message]
2026-01-21 17:59       ` Andy Lutomirski
2026-01-23  6:26         ` Andrei Vagin

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=2026-01-21-tame-yapping-name-paste-hnBZQp@cyphar.com \
    --to=cyphar@cyphar.com \
    --cc=aleksandr.mikhalitsyn@canonical.com \
    --cc=alexander@mihalicyn.com \
    --cc=avagin@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=brauner@kernel.org \
    --cc=corbet@lwn.net \
    --cc=kees@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=shuah@kernel.org \
    --cc=stgraber@stgraber.org \
    --cc=tycho@tycho.pizza \
    --cc=wad@chromium.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