Re: [PATCH 1/4] seccomp: wake poll waiters after failed addfd send

From: Tycho Andersen

Date: Wed Nov 04 2026 - 11:28:06 EST


On Wed, Nov 04, 2026 at 11:37:31AM +0100, Andrea Parri wrote:
> An atomic SECCOMP_IOCTL_NOTIF_ADDFD request stops the listener from
> reporting EPOLLOUT for its notification while the request is pending. If
> installing the file descriptor fails, the notification becomes writable
> again, but poll waiters are not woken. A supervisor waiting for EPOLLOUT
> can then remain asleep, leaving the target blocked in the trapped syscall.
>
> This affects edge-triggered epoll if the supervisor consumed the event
> before the request, and level-triggered epoll, poll() and select() if a
> concurrent waiter found no EPOLLOUT while the request was pending.
>
> The atomic path changes the state from SENT to REPLIED before asking the
> target to install the descriptor. seccomp_handle_addfd() restores SENT on
> failure, but unlike seccomp_notify_recv(), it does not wake poll waiters.
>
> Wake EPOLLOUT waiters on that failure path. Extend the RLIMIT_NOFILE
> test to consume the initial edge and require another after a failed
> ADDFD+SEND.

Hm, don't we return success or failure from
ioctl(SECCOMP_IOCTL_NOTIF_ADDFD) via kaddfd.ret in
seccomp_notify_addfd()?

I don't really understand why this is necessary unless you're ignoring
the return value from that call.

Tycho