{"api_version":"1","generated_at":"2026-12-04T04:10:21+00:00","cve":"CVE-2026-138996","urls":{"html":"https://cve.report/CVE-2026-138996","api":"https://cve.report/api/cve/CVE-2026-138996.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-138996","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-138996"},"summary":{"title":"seccomp: restore knotif->state when SECCOMP_ADDFD_FLAG_SEND is interrupted","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nseccomp: restore knotif->state when SECCOMP_ADDFD_FLAG_SEND is interrupted\n\nIn seccomp_notify_addfd(), when SECCOMP_ADDFD_FLAG_SEND is set in\naddfd.flags, knotif->state is optimistically transitioned from\nSECCOMP_NOTIFY_SENT to SECCOMP_NOTIFY_REPLIED before waking the tracee\nand waiting on kaddfd.completion:\n\n\tif (addfd.flags & SECCOMP_ADDFD_FLAG_SEND) {\n\t\tknotif->state = SECCOMP_NOTIFY_REPLIED;\n\t\t...\n\t}\n\nIf wait_for_completion_interruptible(&kaddfd.completion) is interrupted\nby a signal before the tracee dequeues the kaddfd request\n(!list_empty(&kaddfd.list)), seccomp_notify_addfd() removes kaddfd from\nknotif->addfd and returns -EINTR to the supervisor without having\ninstalled the file descriptor.\n\nHowever, knotif->state is left as SECCOMP_NOTIFY_REPLIED (with\nknotif->error == 0 and knotif->val == 0). This causes two problems:\n\n1. When the tracee runs in do_user_notif(), it checks\n   if (knotif.state != SECCOMP_NOTIFY_REPLIED) after calling\n   seccomp_handle_addfd(). Because knotif->state is already\n   SECCOMP_NOTIFY_REPLIED, the tracee exits the notification wait loop\n   prematurely and returns 0 from the trapped syscall without the file\n   descriptor ever having been installed.\n\n2. If the supervisor retries SECCOMP_IOCTL_NOTIF_ADDFD or\n   SECCOMP_IOCTL_NOTIF_SEND before the tracee runs, it fails with\n   -EINPROGRESS because knotif->state is no longer SECCOMP_NOTIFY_SENT.\n\nFix this by restoring knotif->state back to SECCOMP_NOTIFY_SENT if\nSECCOMP_ADDFD_FLAG_SEND was set and kaddfd was not consumed before the\ninterrupted wait. Also add a seccomp_bpf selftest\n(user_notification_addfd_send_interrupted) covering this race.\n\nTested in QEMU against Linux 7.3.0-rc3 using the\nuser_notification_addfd_send_interrupted selftest added in this patch\n(./seccomp_bpf -t user_notification_addfd_send_interrupted): on the\nunfixed kernel the test fails because the retry ioctl(listener,\nSECCOMP_IOCTL_NOTIF_ADDFD, &addfd) returns -EINPROGRESS (-1) and the\ntracee prematurely exits do_user_notif() with return value 0 instead of\nFD 42, whereas with this patch applied the test passes.","state":"PUBLISHED","assigner":"Linux","published_at":"2026-11-30 14:18:02","updated_at":"2026-11-30 14:18:02"},"problem_types":[],"metrics":[],"references":[{"url":"https://git.kernel.org/stable/c/71a0eaa2ac84e20a9bf0fd40edd1eddd36181e6a","name":"https://git.kernel.org/stable/c/71a0eaa2ac84e20a9bf0fd40edd1eddd36181e6a","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/872bd917485f9332469a793a10c164a450813d6a","name":"https://git.kernel.org/stable/c/872bd917485f9332469a793a10c164a450813d6a","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/86ad71967cca94b6972fc3ef099d494ebff6c290","name":"https://git.kernel.org/stable/c/86ad71967cca94b6972fc3ef099d494ebff6c290","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/2849bbaafd4f485aee87109d4225eb222eee5418","name":"https://git.kernel.org/stable/c/2849bbaafd4f485aee87109d4225eb222eee5418","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/386bab3924f755841d22a3004aa666015a28f9fc","name":"https://git.kernel.org/stable/c/386bab3924f755841d22a3004aa666015a28f9fc","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/fdab56398223c6084ca5a8dd1d5e5ed3262ce44f","name":"https://git.kernel.org/stable/c/fdab56398223c6084ca5a8dd1d5e5ed3262ce44f","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/832b9b176be06a20747a267db6bc0010a24b74f4","name":"https://git.kernel.org/stable/c/832b9b176be06a20747a267db6bc0010a24b74f4","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-138996","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-138996","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 0ae71c7720e3ae3aabd2e8a072d27f7bd173d25c fdab56398223c6084ca5a8dd1d5e5ed3262ce44f git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 0ae71c7720e3ae3aabd2e8a072d27f7bd173d25c 386bab3924f755841d22a3004aa666015a28f9fc git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 0ae71c7720e3ae3aabd2e8a072d27f7bd173d25c 86ad71967cca94b6972fc3ef099d494ebff6c290 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 0ae71c7720e3ae3aabd2e8a072d27f7bd173d25c 2849bbaafd4f485aee87109d4225eb222eee5418 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 0ae71c7720e3ae3aabd2e8a072d27f7bd173d25c 872bd917485f9332469a793a10c164a450813d6a git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 0ae71c7720e3ae3aabd2e8a072d27f7bd173d25c 71a0eaa2ac84e20a9bf0fd40edd1eddd36181e6a git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 0ae71c7720e3ae3aabd2e8a072d27f7bd173d25c 832b9b176be06a20747a267db6bc0010a24b74f4 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 31a5fc473d74d943438a03f83f519aac8d65ebe3 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 5.13.2 5.14 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 5.14","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 5.14 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 5.15.226 5.15.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.1.193 6.1.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.6.163 6.6.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.12.117 6.12.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.18.63 6.18.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.3.4 7.3.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.4-rc1 * original_commit_for_fix","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"cna":{"affected":[{"defaultStatus":"unaffected","product":"Linux","programFiles":["kernel/seccomp.c","tools/testing/selftests/seccomp/seccomp_bpf.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"lessThan":"fdab56398223c6084ca5a8dd1d5e5ed3262ce44f","status":"affected","version":"0ae71c7720e3ae3aabd2e8a072d27f7bd173d25c","versionType":"git"},{"lessThan":"386bab3924f755841d22a3004aa666015a28f9fc","status":"affected","version":"0ae71c7720e3ae3aabd2e8a072d27f7bd173d25c","versionType":"git"},{"lessThan":"86ad71967cca94b6972fc3ef099d494ebff6c290","status":"affected","version":"0ae71c7720e3ae3aabd2e8a072d27f7bd173d25c","versionType":"git"},{"lessThan":"2849bbaafd4f485aee87109d4225eb222eee5418","status":"affected","version":"0ae71c7720e3ae3aabd2e8a072d27f7bd173d25c","versionType":"git"},{"lessThan":"872bd917485f9332469a793a10c164a450813d6a","status":"affected","version":"0ae71c7720e3ae3aabd2e8a072d27f7bd173d25c","versionType":"git"},{"lessThan":"71a0eaa2ac84e20a9bf0fd40edd1eddd36181e6a","status":"affected","version":"0ae71c7720e3ae3aabd2e8a072d27f7bd173d25c","versionType":"git"},{"lessThan":"832b9b176be06a20747a267db6bc0010a24b74f4","status":"affected","version":"0ae71c7720e3ae3aabd2e8a072d27f7bd173d25c","versionType":"git"},{"status":"affected","version":"31a5fc473d74d943438a03f83f519aac8d65ebe3","versionType":"git"},{"lessThan":"5.14","status":"affected","version":"5.13.2","versionType":"semver"}]},{"defaultStatus":"affected","product":"Linux","programFiles":["kernel/seccomp.c","tools/testing/selftests/seccomp/seccomp_bpf.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"status":"affected","version":"5.14"},{"lessThan":"5.14","status":"unaffected","version":"0","versionType":"semver"},{"lessThanOrEqual":"5.15.*","status":"unaffected","version":"5.15.226","versionType":"semver"},{"lessThanOrEqual":"6.1.*","status":"unaffected","version":"6.1.193","versionType":"semver"},{"lessThanOrEqual":"6.6.*","status":"unaffected","version":"6.6.163","versionType":"semver"},{"lessThanOrEqual":"6.12.*","status":"unaffected","version":"6.12.117","versionType":"semver"},{"lessThanOrEqual":"6.18.*","status":"unaffected","version":"6.18.63","versionType":"semver"},{"lessThanOrEqual":"7.3.*","status":"unaffected","version":"7.3.4","versionType":"semver"},{"lessThanOrEqual":"*","status":"unaffected","version":"7.4-rc1","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"5.15.226","versionStartIncluding":"5.14","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.1.193","versionStartIncluding":"5.14","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.6.163","versionStartIncluding":"5.14","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.12.117","versionStartIncluding":"5.14","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.18.63","versionStartIncluding":"5.14","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.3.4","versionStartIncluding":"5.14","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.4-rc1","versionStartIncluding":"5.14","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.13.2","vulnerable":true}],"negate":false,"operator":"OR"}]}],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nseccomp: restore knotif->state when SECCOMP_ADDFD_FLAG_SEND is interrupted\n\nIn seccomp_notify_addfd(), when SECCOMP_ADDFD_FLAG_SEND is set in\naddfd.flags, knotif->state is optimistically transitioned from\nSECCOMP_NOTIFY_SENT to SECCOMP_NOTIFY_REPLIED before waking the tracee\nand waiting on kaddfd.completion:\n\n\tif (addfd.flags & SECCOMP_ADDFD_FLAG_SEND) {\n\t\tknotif->state = SECCOMP_NOTIFY_REPLIED;\n\t\t...\n\t}\n\nIf wait_for_completion_interruptible(&kaddfd.completion) is interrupted\nby a signal before the tracee dequeues the kaddfd request\n(!list_empty(&kaddfd.list)), seccomp_notify_addfd() removes kaddfd from\nknotif->addfd and returns -EINTR to the supervisor without having\ninstalled the file descriptor.\n\nHowever, knotif->state is left as SECCOMP_NOTIFY_REPLIED (with\nknotif->error == 0 and knotif->val == 0). This causes two problems:\n\n1. When the tracee runs in do_user_notif(), it checks\n   if (knotif.state != SECCOMP_NOTIFY_REPLIED) after calling\n   seccomp_handle_addfd(). Because knotif->state is already\n   SECCOMP_NOTIFY_REPLIED, the tracee exits the notification wait loop\n   prematurely and returns 0 from the trapped syscall without the file\n   descriptor ever having been installed.\n\n2. If the supervisor retries SECCOMP_IOCTL_NOTIF_ADDFD or\n   SECCOMP_IOCTL_NOTIF_SEND before the tracee runs, it fails with\n   -EINPROGRESS because knotif->state is no longer SECCOMP_NOTIFY_SENT.\n\nFix this by restoring knotif->state back to SECCOMP_NOTIFY_SENT if\nSECCOMP_ADDFD_FLAG_SEND was set and kaddfd was not consumed before the\ninterrupted wait. Also add a seccomp_bpf selftest\n(user_notification_addfd_send_interrupted) covering this race.\n\nTested in QEMU against Linux 7.3.0-rc3 using the\nuser_notification_addfd_send_interrupted selftest added in this patch\n(./seccomp_bpf -t user_notification_addfd_send_interrupted): on the\nunfixed kernel the test fails because the retry ioctl(listener,\nSECCOMP_IOCTL_NOTIF_ADDFD, &addfd) returns -EINPROGRESS (-1) and the\ntracee prematurely exits do_user_notif() with return value 0 instead of\nFD 42, whereas with this patch applied the test passes."}],"providerMetadata":{"dateUpdated":"2026-11-30T13:26:54.623Z","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux"},"references":[{"url":"https://git.kernel.org/stable/c/fdab56398223c6084ca5a8dd1d5e5ed3262ce44f"},{"url":"https://git.kernel.org/stable/c/386bab3924f755841d22a3004aa666015a28f9fc"},{"url":"https://git.kernel.org/stable/c/86ad71967cca94b6972fc3ef099d494ebff6c290"},{"url":"https://git.kernel.org/stable/c/2849bbaafd4f485aee87109d4225eb222eee5418"},{"url":"https://git.kernel.org/stable/c/872bd917485f9332469a793a10c164a450813d6a"},{"url":"https://git.kernel.org/stable/c/71a0eaa2ac84e20a9bf0fd40edd1eddd36181e6a"},{"url":"https://git.kernel.org/stable/c/832b9b176be06a20747a267db6bc0010a24b74f4"}],"title":"seccomp: restore knotif->state when SECCOMP_ADDFD_FLAG_SEND is interrupted","x_generator":{"engine":"bippy-1.2.0"}}},"cveMetadata":{"assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","assignerShortName":"Linux","cveId":"CVE-2026-138996","datePublished":"2026-11-30T13:26:54.623Z","dateReserved":"2026-11-30T13:22:15.908Z","dateUpdated":"2026-11-30T13:26:54.623Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-11-30 14:18:02","lastModifiedDate":"2026-11-30 14:18:02","problem_types":[],"metrics":[],"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"138996","Ordinal":"1","Title":"seccomp: restore knotif->state when SECCOMP_ADDFD_FLAG_SEND is i","CVE":"CVE-2026-138996","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"138996","Ordinal":"1","NoteData":"In the Linux kernel, the following vulnerability has been resolved:\n\nseccomp: restore knotif->state when SECCOMP_ADDFD_FLAG_SEND is interrupted\n\nIn seccomp_notify_addfd(), when SECCOMP_ADDFD_FLAG_SEND is set in\naddfd.flags, knotif->state is optimistically transitioned from\nSECCOMP_NOTIFY_SENT to SECCOMP_NOTIFY_REPLIED before waking the tracee\nand waiting on kaddfd.completion:\n\n\tif (addfd.flags & SECCOMP_ADDFD_FLAG_SEND) {\n\t\tknotif->state = SECCOMP_NOTIFY_REPLIED;\n\t\t...\n\t}\n\nIf wait_for_completion_interruptible(&kaddfd.completion) is interrupted\nby a signal before the tracee dequeues the kaddfd request\n(!list_empty(&kaddfd.list)), seccomp_notify_addfd() removes kaddfd from\nknotif->addfd and returns -EINTR to the supervisor without having\ninstalled the file descriptor.\n\nHowever, knotif->state is left as SECCOMP_NOTIFY_REPLIED (with\nknotif->error == 0 and knotif->val == 0). This causes two problems:\n\n1. When the tracee runs in do_user_notif(), it checks\n   if (knotif.state != SECCOMP_NOTIFY_REPLIED) after calling\n   seccomp_handle_addfd(). Because knotif->state is already\n   SECCOMP_NOTIFY_REPLIED, the tracee exits the notification wait loop\n   prematurely and returns 0 from the trapped syscall without the file\n   descriptor ever having been installed.\n\n2. If the supervisor retries SECCOMP_IOCTL_NOTIF_ADDFD or\n   SECCOMP_IOCTL_NOTIF_SEND before the tracee runs, it fails with\n   -EINPROGRESS because knotif->state is no longer SECCOMP_NOTIFY_SENT.\n\nFix this by restoring knotif->state back to SECCOMP_NOTIFY_SENT if\nSECCOMP_ADDFD_FLAG_SEND was set and kaddfd was not consumed before the\ninterrupted wait. Also add a seccomp_bpf selftest\n(user_notification_addfd_send_interrupted) covering this race.\n\nTested in QEMU against Linux 7.3.0-rc3 using the\nuser_notification_addfd_send_interrupted selftest added in this patch\n(./seccomp_bpf -t user_notification_addfd_send_interrupted): on the\nunfixed kernel the test fails because the retry ioctl(listener,\nSECCOMP_IOCTL_NOTIF_ADDFD, &addfd) returns -EINPROGRESS (-1) and the\ntracee prematurely exits do_user_notif() with return value 0 instead of\nFD 42, whereas with this patch applied the test passes.","Type":"Description","Title":"seccomp: restore knotif->state when SECCOMP_ADDFD_FLAG_SEND is i"}]}}}