HIGH Introduced in 6.13
xfrm StateCache UAF
CVE-2026-98230
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI7.0HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: xfrm: use hlist_del_init_rcu for state_cache and state_cache_input Commit 14acf9652e56 ("xfrm: defensively unhash xfrm_state lists in __xfrm_state_delete") converted bydst/bysrc/byseq/byspi from hlist_del_rcu() to hlist_del_init_rcu() so that a second __xfrm_state_delete() on the same object becomes a no-op rather than a write through LIST_POISON pprev. It missed state_cache and state_cache_input, which kept hlist_del_rcu(): - hlist_del_rcu() leaves pprev = LIST_POISON2 (non-NULL), so hlist_unhashed() returns false. - hlist_del_init_rcu() leaves pprev = NULL, so hlist_unhashed() returns true. A second __xfrm_state_delete() therefore enters __hlist_del() on the already-deleted state_cache/state_cache_input nodes and does WRITE_ONCE(*pprev, next) through LIST_POISON2 — a write use-after-free once the slab is reused. The corruption can in turn cause a subsequent hlist_for_each_entry_rcu traversal to follow a dangling next pointer, producing the read use-after-free reported in xfrm_input_state_lookup(). Switch state_cache and state_cache_input to hlist_del_init_rcu() to match the other four lists, closing the write use-after-free and, with it, the read use-after-free it spawns.
02KernelScan AI Analysis
Risk summary
A use-after-free in the XFRM (IPsec) state cache allows a local attacker with CAP_NET_ADMIN (obtainable in a user namespace) to corrupt kernel heap memory by racing two concurrent state deletion operations. The corruption can lead to arbitrary read/write of kernel memory or a kernel crash. Any system with IPsec/VPN configured and unprivileged user namespaces enabled is at risk.
Vulnerability analysis
When an IPsec security association is deleted, two per-CPU cache list nodes are removed with a deletion routine that leaves a non-NULL poison marker in the node's back-pointer instead of marking it as unhashed. If a second concurrent deletion of the same state object occurs (a race between overlapping cleanup paths), the kernel re-enters the deletion logic, dereferences the poison marker as a valid pointer, and writes through it into memory that may have already been freed and reused by the slab allocator. This write corruption can in turn cause subsequent IPsec state cache lookups to follow dangling list pointers, producing a read use-after-free. The fix switches these two list nodes to the same safe deletion helper already used by the other four state lists, which sets the back-pointer to NULL so that a second deletion becomes a no-op. The vulnerable path is reachable from an unprivileged local user who creates a user namespace with a new network namespace to obtain CAP_NET_ADMIN, then races concurrent XFRM state deletion operations via netlink; systems without IPsec configured are not affected.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.12 | 6.12.13 | 6.12.112 | fb38fb7420d5 |
| 6.18 | 6.13 | 6.18.54 | 4748c27e2e6a |
| 7.2 | 6.13 | 7.2.8 | 9b74a47a4cbd |
| mainline | 6.13 | 7.3 | 2afb8dc1f439 |
| cip/6.12 | 6.13 | 6.12.112-cip33 | fb38fb7420d5 |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Fixed in 6.12.112-cip33 |