seccomp: restore knotif->state when SECCOMP_ADDFD_FLAG_SEND is interrupted

Summary

CVECVE-2026-138996
StatePUBLISHED
AssignerLinux
Source PriorityCVE Program / NVD first with legacy fallback
Published2026-11-30 14:18:02 UTC
Updated2026-11-30 14:18:02 UTC
DescriptionIn the Linux kernel, the following vulnerability has been resolved: seccomp: restore knotif->state when SECCOMP_ADDFD_FLAG_SEND is interrupted In seccomp_notify_addfd(), when SECCOMP_ADDFD_FLAG_SEND is set in addfd.flags, knotif->state is optimistically transitioned from SECCOMP_NOTIFY_SENT to SECCOMP_NOTIFY_REPLIED before waking the tracee and waiting on kaddfd.completion: if (addfd.flags & SECCOMP_ADDFD_FLAG_SEND) { knotif->state = SECCOMP_NOTIFY_REPLIED; ... } If wait_for_completion_interruptible(&kaddfd.completion) is interrupted by a signal before the tracee dequeues the kaddfd request (!list_empty(&kaddfd.list)), seccomp_notify_addfd() removes kaddfd from knotif->addfd and returns -EINTR to the supervisor without having installed the file descriptor. However, knotif->state is left as SECCOMP_NOTIFY_REPLIED (with knotif->error == 0 and knotif->val == 0). This causes two problems: 1. When the tracee runs in do_user_notif(), it checks if (knotif.state != SECCOMP_NOTIFY_REPLIED) after calling seccomp_handle_addfd(). Because knotif->state is already SECCOMP_NOTIFY_REPLIED, 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 SECCOMP_IOCTL_NOTIF_ADDFD or SECCOMP_IOCTL_NOTIF_SEND before the tracee runs, it fails with -EINPROGRESS because knotif->state is no longer SECCOMP_NOTIFY_SENT. Fix this by restoring knotif->state back to SECCOMP_NOTIFY_SENT if SECCOMP_ADDFD_FLAG_SEND was set and kaddfd was not consumed before the interrupted wait. Also add a seccomp_bpf selftest (user_notification_addfd_send_interrupted) covering this race. Tested in QEMU against Linux 7.3.0-rc3 using the user_notification_addfd_send_interrupted selftest added in this patch (./seccomp_bpf -t user_notification_addfd_send_interrupted): on the unfixed kernel the test fails because the retry ioctl(listener, SECCOMP_IOCTL_NOTIF_ADDFD, &addfd) returns -EINPROGRESS (-1) and the tracee prematurely exits do_user_notif() with return value 0 instead of FD 42, whereas with this patch applied the test passes.

Vendor Declared Affected Products

SourceVendorProductVersionPlatforms
CNA Linux Linux affected 0ae71c7720e3ae3aabd2e8a072d27f7bd173d25c fdab56398223c6084ca5a8dd1d5e5ed3262ce44f git Not specified
CNA Linux Linux affected 0ae71c7720e3ae3aabd2e8a072d27f7bd173d25c 386bab3924f755841d22a3004aa666015a28f9fc git Not specified
CNA Linux Linux affected 0ae71c7720e3ae3aabd2e8a072d27f7bd173d25c 86ad71967cca94b6972fc3ef099d494ebff6c290 git Not specified
CNA Linux Linux affected 0ae71c7720e3ae3aabd2e8a072d27f7bd173d25c 2849bbaafd4f485aee87109d4225eb222eee5418 git Not specified
CNA Linux Linux affected 0ae71c7720e3ae3aabd2e8a072d27f7bd173d25c 872bd917485f9332469a793a10c164a450813d6a git Not specified
CNA Linux Linux affected 0ae71c7720e3ae3aabd2e8a072d27f7bd173d25c 71a0eaa2ac84e20a9bf0fd40edd1eddd36181e6a git Not specified
CNA Linux Linux affected 0ae71c7720e3ae3aabd2e8a072d27f7bd173d25c 832b9b176be06a20747a267db6bc0010a24b74f4 git Not specified
CNA Linux Linux affected 31a5fc473d74d943438a03f83f519aac8d65ebe3 git Not specified
CNA Linux Linux affected 5.13.2 5.14 semver Not specified
CNA Linux Linux affected 5.14 Not specified
CNA Linux Linux unaffected 5.14 semver Not specified
CNA Linux Linux unaffected 5.15.226 5.15.* semver Not specified
CNA Linux Linux unaffected 6.1.193 6.1.* semver Not specified
CNA Linux Linux unaffected 6.6.163 6.6.* semver Not specified
CNA Linux Linux unaffected 6.12.117 6.12.* semver Not specified
CNA Linux Linux unaffected 6.18.63 6.18.* semver Not specified
CNA Linux Linux unaffected 7.3.4 7.3.* semver Not specified
CNA Linux Linux unaffected 7.4-rc1 * original_commit_for_fix Not specified

References

ReferenceSourceLinkTags
git.kernel.org/stable/c/71a0eaa2ac84e20a9bf0fd40edd1eddd36181e6a 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/872bd917485f9332469a793a10c164a450813d6a 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/86ad71967cca94b6972fc3ef099d494ebff6c290 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/2849bbaafd4f485aee87109d4225eb222eee5418 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/386bab3924f755841d22a3004aa666015a28f9fc 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/fdab56398223c6084ca5a8dd1d5e5ed3262ce44f 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/832b9b176be06a20747a267db6bc0010a24b74f4 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
CVE Program record CVE.ORG www.cve.org canonical
NVD vulnerability detail NVD nvd.nist.gov canonical, analysis

© CVE.report 2026

Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.

CVE, CWE, and OVAL are registred trademarks of The MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. This site includes MITRE data granted under the following license.

Free CVE JSON API cve.report/api

CVE.report and Source URL Uptime Status status.cve.report