HIGH Introduced in 6.11
xfrm StateGC UAF
CVE-2026-98231
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
01Description
In the Linux kernel, the following vulnerability has been resolved: xfrm: serialize state GC with device state flush The deferred-device pass in xfrm_dev_state_flush() finds states under xfrm_state_dev_gc_lock, but drops the lock before calling xfrm_dev_state_free() because the driver callback may sleep. The device GC list does not hold an xfrm_state reference, so the state GC worker can destroy the same state concurrently. The race can proceed as follows: CPU 0 CPU 1 find x on the device GC list drop xfrm_state_dev_gc_lock read x->xso.dev xfrm_state_gc_destroy(x) xfrm_dev_state_free(x) xfrm_state_free(x) continue xfrm_dev_state_free(x) Both paths can invoke the driver callback and drop the device reference. CPU 0 can also access the xfrm_state after CPU 1 has freed it. KASAN reported: BUG: KASAN: slab-use-after-free in xfrm_dev_state_free+0x24c/0x2a0 Read of size 8 at addr ffff88810bbaa960 by task poc/102 Call Trace: xfrm_dev_state_free+0x24c/0x2a0 xfrm_dev_state_flush+0x353/0x400 xfrm_dev_event+0x26d/0x3a0 notifier_call_chain+0xc0/0x280 __dev_notify_flags+0x169/0x250 netif_change_flags+0xe7/0x160 dev_change_flags+0x96/0x220 devinet_ioctl+0x7f4/0x1880 Allocated by task 87: xfrm_state_alloc+0x1e/0x5c0 xfrm_add_sa+0xe7f/0x5820 xfrm_user_rcv_msg+0x4f3/0x940 Freed by task 57: kmem_cache_free+0xcb/0x3d0 xfrm_state_gc_task+0x4a8/0x650 process_one_work+0x63a/0x1070 Serialize xfrm_state destruction against the deferred-device pass with a mutex. Keep xfrm_state_dev_gc_lock limited to list operations and retain the existing callback and device-reference release ordering.
02KernelScan AI Analysis
Risk summary
A race condition in the Linux kernel's XFRM (IPsec) state management allows concurrent destruction of the same security association state from two code paths, leading to a use-after-free. An unprivileged local attacker who can obtain CAP_NET_ADMIN via a user namespace can trigger this race to corrupt kernel memory, potentially achieving privilege escalation or causing a kernel panic. Systems running untrusted workloads in containers or multi-tenant environments are most at risk.
Vulnerability analysis
A race condition in the XFRM IPsec subsystem allows a device cleanup routine and an asynchronous garbage collection worker to operate on the same security association simultaneously. The cleanup list does not hold a reference to the state object, so the garbage collector can free it while the cleanup routine is still using it. This leads to a use-after-free where both paths may invoke hardware driver callbacks and release device references on freed memory. The fix adds a lock that serializes destruction between the garbage collector and the device cleanup path. The vulnerability is reachable locally through IPsec configuration operations and network device changes, both requiring CAP_NET_ADMIN, which an unprivileged user can acquire through a user namespace.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.10 | 6.10.3 | 6.11 | 39e41af3653e |
| 6.12 | 6.11 | 6.12.112 | 75fc4561772e |
| 6.18 | 6.11 | 6.18.54 | 84e378395494 |
| 6.6 | 6.6.44 | 6.6.158 | 937108dc0258 |
| 7.2 | 6.11 | 7.2.8 | 89fefad9f971 |
| mainline | 6.11 | 7.3 | — |
| cip/6.12 | 6.11 | 6.12.112-cip33 | 39e41af3653e |
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 |