{"id":"CVE-2026-31406","state":"PUBLISHED","title":"xfrm: Fix work re-schedule after cancel in xfrm_nat_keepalive_net_fini()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nxfrm: Fix work re-schedule after cancel in xfrm_nat_keepalive_net_fini()\n\nAfter cancel_delayed_work_sync() is called from\nxfrm_nat_keepalive_net_fini(), xfrm_state_fini() flushes remaining\nstates via __xfrm_state_delete(), which calls\nxfrm_nat_keepalive_state_updated() to re-schedule nat_keepalive_work.\n\nThe following is a simple race scenario:\n\n           cpu0                             cpu1\n\ncleanup_net() [Round 1]\n  ops_undo_list()\n    xfrm_net_exit()\n      xfrm_nat_keepalive_net_fini()\n        cancel_delayed_work_sync(nat_keepalive_work);\n      xfrm_state_fini()\n        xfrm_state_flush()\n          xfrm_state_delete(x)\n            __xfrm_state_delete(x)\n              xfrm_nat_keepalive_state_updated(x)\n                schedule_delayed_work(nat_keepalive_work);\n  rcu_barrier();\n  net_complete_free();\n  net_passive_dec(net);\n    llist_add(&net->defer_free_list, &defer_free_list);\n\ncleanup_net() [Round 2]\n  rcu_barrier();\n  net_complete_free()\n    kmem_cache_free(net_cachep, net);\n                                     nat_keepalive_work()\n                                       // on freed net\n\nTo prevent this, cancel_delayed_work_sync() is replaced with\ndisable_delayed_work_sync().","publishedAt":"2026-04-06T07:38:18.840Z","updatedAt":"2026-08-05T12:22:15.395Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"f531d13bdfe3f4f084aaa8acae2cb0f02295f5ae","status":"affected","lessThan":"32d0f44c2f14d60fe8e920e69a28c11051543ec1","versionType":"git"},{"version":"f531d13bdfe3f4f084aaa8acae2cb0f02295f5ae","status":"affected","lessThan":"2255ed6adbc3100d2c4a83abd9d0396d04b87792","versionType":"git"},{"version":"f531d13bdfe3f4f084aaa8acae2cb0f02295f5ae","status":"affected","lessThan":"21f2fc49ca6faa393c31da33b8a4e6c41fc84c13","versionType":"git"},{"version":"f531d13bdfe3f4f084aaa8acae2cb0f02295f5ae","status":"affected","lessThan":"daf8e3b253aa760ff9e96c7768a464bc1d6b3c90","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/xfrm/xfrm_nat_keepalive.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.11","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.11","versionType":"semver"},{"version":"6.12.80","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.21","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"6.19.11","status":"unaffected","lessThanOrEqual":"6.19.*","versionType":"semver"},{"version":"7.0","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/xfrm/xfrm_nat_keepalive.c"]}],"references":["https://git.kernel.org/stable/c/32d0f44c2f14d60fe8e920e69a28c11051543ec1","https://git.kernel.org/stable/c/2255ed6adbc3100d2c4a83abd9d0396d04b87792","https://git.kernel.org/stable/c/21f2fc49ca6faa393c31da33b8a4e6c41fc84c13","https://git.kernel.org/stable/c/daf8e3b253aa760ff9e96c7768a464bc1d6b3c90"],"weaknesses":[],"ingestedAt":"2026-10-29T20:11:40.391Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/31xxx/CVE-2026-31406.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-31406","state":"PUBLISHED","datePublished":"2026-04-06T07:38:18.840Z","dateUpdated":"2026-08-05T12:22:15.395Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-03-09T15:48:24.086Z"},"containers":{"cna":{"title":"xfrm: Fix work re-schedule after cancel in xfrm_nat_keepalive_net_fini()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nxfrm: Fix work re-schedule after cancel in xfrm_nat_keepalive_net_fini()\n\nAfter cancel_delayed_work_sync() is called from\nxfrm_nat_keepalive_net_fini(), xfrm_state_fini() flushes remaining\nstates via __xfrm_state_delete(), which calls\nxfrm_nat_keepalive_state_updated() to re-schedule nat_keepalive_work.\n\nThe following is a simple race scenario:\n\n           cpu0                             cpu1\n\ncleanup_net() [Round 1]\n  ops_undo_list()\n    xfrm_net_exit()\n      xfrm_nat_keepalive_net_fini()\n        cancel_delayed_work_sync(nat_keepalive_work);\n      xfrm_state_fini()\n        xfrm_state_flush()\n          xfrm_state_delete(x)\n            __xfrm_state_delete(x)\n              xfrm_nat_keepalive_state_updated(x)\n                schedule_delayed_work(nat_keepalive_work);\n  rcu_barrier();\n  net_complete_free();\n  net_passive_dec(net);\n    llist_add(&net->defer_free_list, &defer_free_list);\n\ncleanup_net() [Round 2]\n  rcu_barrier();\n  net_complete_free()\n    kmem_cache_free(net_cachep, net);\n                                     nat_keepalive_work()\n                                       // on freed net\n\nTo prevent this, cancel_delayed_work_sync() is replaced with\ndisable_delayed_work_sync()."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"f531d13bdfe3f4f084aaa8acae2cb0f02295f5ae","status":"affected","lessThan":"32d0f44c2f14d60fe8e920e69a28c11051543ec1","versionType":"git"},{"version":"f531d13bdfe3f4f084aaa8acae2cb0f02295f5ae","status":"affected","lessThan":"2255ed6adbc3100d2c4a83abd9d0396d04b87792","versionType":"git"},{"version":"f531d13bdfe3f4f084aaa8acae2cb0f02295f5ae","status":"affected","lessThan":"21f2fc49ca6faa393c31da33b8a4e6c41fc84c13","versionType":"git"},{"version":"f531d13bdfe3f4f084aaa8acae2cb0f02295f5ae","status":"affected","lessThan":"daf8e3b253aa760ff9e96c7768a464bc1d6b3c90","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/xfrm/xfrm_nat_keepalive.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.11","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.11","versionType":"semver"},{"version":"6.12.80","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.21","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"6.19.11","status":"unaffected","lessThanOrEqual":"6.19.*","versionType":"semver"},{"version":"7.0","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/xfrm/xfrm_nat_keepalive.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/32d0f44c2f14d60fe8e920e69a28c11051543ec1"},{"url":"https://git.kernel.org/stable/c/2255ed6adbc3100d2c4a83abd9d0396d04b87792"},{"url":"https://git.kernel.org/stable/c/21f2fc49ca6faa393c31da33b8a4e6c41fc84c13"},{"url":"https://git.kernel.org/stable/c/daf8e3b253aa760ff9e96c7768a464bc1d6b3c90"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The vulnerable path is reached through local namespace lifecycle and NETLINK_XFRM state configuration, not by remote packet processing. An attacker can create an affected outbound ESP-in-UDP XFRM state locally and tear down the network namespace.\nAC:L - The attacker controls creation of the NAT keepalive state and repeated teardown of the network namespace; the work reschedule after cancel is a direct consequence of the cleanup ordering. Any scheduling race can be retried and influenced locally, so there are no hard external conditions.\nPR:L - XFRM netlink operations require CAP_NET_ADMIN in the target network namespace. This is reachable by an unprivileged local user through a user namespace plus network namespace where they hold CAP_NET_ADMIN.\nUI:N - No victim action is required after the attacker runs local code. The attacker can configure the state and trigger namespace cleanup directly.\nS:U - The vulnerability corrupts kernel memory within the same kernel security authority. It is a standard local kernel compromise scenario, not a VM or hardware boundary escape.\nC:H - This is a use-after-free of a network namespace embedded delayed_work object and subsequent XFRM/netns state access. Per kernel scoring guidance, UAFs are treated as enabling high confidentiality impact.\nI:H - The dangling work item can operate on freed and potentially reclaimed kernel memory, giving a plausible path to memory corruption and control-flow compromise. Per kernel scoring guidance, UAFs are treated as high integrity impact.\nA:H - At minimum, executing delayed work on a freed struct net can dereference freed XFRM state and namespace data, causing an oops or panic. Repeated local triggering can reliably deny service."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T12:22:15.395Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.11","versionEndExcluding":"6.12.80"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.11","versionEndExcluding":"6.18.21"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.11","versionEndExcluding":"6.19.11"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.11","versionEndExcluding":"7.0"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}