From: Kees Cook <kees@kernel.org>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Jinjie Ruan <ruanjinjie@huawei.com>,
tglx@kernel.org, peterz@infradead.org, luto@kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] entry: Fix seccomp bypass after ptrace with TSYNC
Date: Thu, 15 Oct 2026 09:16:33 -0700 [thread overview]
Message-ID: <20261015161550.79fd37-kees@kernel.org> (raw)
In-Reply-To: <as9Jqi5BvSZWfxj8@redhat.com>
On Wed, Oct 14, 2026 at 11:21:46AM +0200, Oleg Nesterov wrote:
> I agree with this patch, but SECCOMP_FILTER_FLAG_TSYNC can also happen
> after syscall_trace_enter() re-reads ->syscall_work ?
>
> And this race is possible even without ptrace, SECCOMP_FILTER_FLAG_TSYNC
> from another thread can happen after syscall_enter_from_user_mode_work()
> reads ->syscall_work ?
Right, and that's expected: TSYNC has never covered a syscall a thread
has already entered; the filter applies from the thread's next syscall.
It also only matters for a thread's first filter. Once SYSCALL_WORK_SECCOMP
is set, seccomp_run_filters() loads current->seccomp.filter when it runs,
so a thread that already has a filter sees a newly synced one even with
stale work flags.
> I think we don't really care, but I don't understand the security concerns.
> If debugger controls the process before it installs the seccomp filters, it
> can simply nack sys_seccomp().
>
> In short, does CVE-2026-89603 make real sense?
I don't think it does. For the missed check to matter, the thread had
no filter when it entered the syscall, and the tracer had it stopped
there. That tracer could already make it run any syscall before the
filter existed, or, as you say, refuse the seccomp() call. Nothing gets
past a filter that was in place when the syscall started. I'll ask
the CVE team to reject it.
The patch is still right as a consistency fix: seccomp runs after
ptrace so it checks what the tracer left. arm64 re-tests the flag after
the ptrace stop, as powerpc, riscv, and s390 did before they moved to
generic entry.
I've sent a selftest for the ptrace case, based on Jinjie's reproducer:
https://lore.kernel.org/all/20261015161348.i.779-kees@kernel.org/
-Kees
--
Kees Cook
prev parent reply other threads:[~2026-10-15 16:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-13 2:57 Jinjie Ruan
2026-07-14 7:36 ` Jinjie Ruan
2026-07-14 14:40 ` [tip: core/entry] " tip-bot2 for Jinjie Ruan
2026-10-14 9:21 ` [PATCH v2] " Oleg Nesterov
2026-10-15 16:16 ` 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=20261015161550.79fd37-kees@kernel.org \
--to=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=ruanjinjie@huawei.com \
--cc=tglx@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
all inboxes | Powered by JetHome®