CVE-2026-138996: seccomp: restore knotif->state when SECCOMP_ADDFD_FLAG_SEND is interrupted

Published Nov 30, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

seccomp: restore knotif->state when SECCOMPADDFDFLAGSEND is interrupted

In seccompnotifyaddfd(), when SECCOMPADDFDFLAGSEND is set in addfd.flags, knotif->state is optimistically transitioned from SECCOMPNOTIFYSENT to SECCOMPNOTIFYREPLIED before waking the tracee and waiting on kaddfd.completion:

if (addfd.flags & SECCOMPADDFDFLAGSEND) { knotif->state = SECCOMPNOTIFYREPLIED; ... }

If waitforcompletioninterruptible(&kaddfd.completion) is interrupted by a signal before the tracee dequeues the kaddfd request (!listempty(&kaddfd.list)), seccompnotifyaddfd() removes kaddfd from knotif->addfd and returns -EINTR to the supervisor without having installed the file descriptor.

However, knotif->state is left as SECCOMPNOTIFYREPLIED (with knotif->error == 0 and knotif->val == 0). This causes two problems:

1. When the tracee runs in dousernotif(), it checks if (knotif.state != SECCOMPNOTIFYREPLIED) after calling seccomphandleaddfd(). Because knotif->state is already SECCOMPNOTIFYREPLIED, the tracee exits the notification wait loop prematurely and returns 0 from the trapped syscall without the file descriptor ever having been installed.

2. If the supervisor retries SECCOMPIOCTLNOTIFADDFD or SECCOMPIOCTLNOTIFSEND before the tracee runs, it fails with -EINPROGRESS because knotif->state is no longer SECCOMPNOTIFYSENT.

Fix this by restoring knotif->state back to SECCOMPNOTIFYSENT if SECCOMPADDFDFLAGSEND was set and kaddfd was not consumed before the interrupted wait. Also add a seccompbpf selftest (usernotificationaddfdsendinterrupted) covering this race.

Tested in QEMU against Linux 7.3.0-rc3 using the usernotificationaddfdsendinterrupted selftest added in this patch (./seccompbpf -t usernotificationaddfdsendinterrupted): on the unfixed kernel the test fails because the retry ioctl(listener, SECCOMPIOCTLNOTIFADDFD, &addfd) returns -EINPROGRESS (-1) and the tracee prematurely exits dousernotif() with return value 0 instead of FD 42, whereas with this patch applied the test passes.

Affected Software

1 affected component
Linux Linux kernel

Event History

Nov 30, 2026
CVE Published
via MITRE·01:26 PM
Data Sourced
via MITRE·01:26 PM
Description

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203