Re: [PATCH] seccomp: restore knotif->state when SECCOMP_ADDFD_FLAG_SEND is interrupted

From: Bradley Morgan

Date: Sun Sep 20 2026 - 07:56:22 EST


On 20 September 2026 11:10:45 BST, "Lorenzo Stoakes (ARM)" <ljs@xxxxxxxxxx>
wrote:
>On Sat, Sep 19, 2026 at 08:50:57PM -0700, Kees Cook wrote:
>> On Sat, Sep 19, 2026 at 08:35:14PM +0000, Hui Peng wrote:
>> > In seccomp_notify_addfd(), when SECCOMP_ADDFD_FLAG_SEND is set,
>> > knotif->state is transitioned from SECCOMP_NOTIFY_SENT to
>> > SECCOMP_NOTIFY_REPLIED before dropping filter->notify_lock and waiting
>> > in wait_for_completion_interruptible(&kaddfd.completion).
>> >
>> > If wait_for_completion_interruptible() is interrupted by a signal
>before
>> > the target task processes the kaddfd entry, seccomp_notify_addfd()
>> > removes kaddfd.list from knotif->addfd via list_del(&kaddfd.list), but
>> > leaves knotif->state set to SECCOMP_NOTIFY_REPLIED.
>>
>> Are you able to construct a regression test for this so we can catch
>> this race if it ever gets exposed again?
>
>I'd disregard this guy and treat this as, at best, an AI-generated bug
>report.
>
>He sent 115 patches across 40 subsystems in 2 hours.
>
>https://lore.kernel.org/all/?q=f%3Ahui+peng
>
>Unfortunately I feel we are only at the beginning of this kind of thing :(

Bruh, wasted my time on review. Mad..

I do believe it LGTM though, thanks Lorenzo for the tip.

>
>>
>> --
>> Kees Cook
>>
>
>--
>Cheers, Lorenzo
>
>

--- Thanks!
"I'm not a very positive person" - Linus torvalds