HIGH Introduced in 2.6.25
xfrm Bundle UAF
CVE-2026-98364
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI6.9MEDIUM
01Description
In the Linux kernel, the following vulnerability has been resolved: xfrm: hold net_device reference under RCU in bundle creation xfrm_bundle_create() and xfrm_create_dummy_bundle() read dst->dev into a local pointer without taking a device reference, then pass it to xfrm_fill_dst(). A concurrent RTM_DELLINK replaces dst->dev via dst_dev_put() and frees the old net_device, causing a use-after-free when xfrm6_fill_dst() later dereferences the stale dev pointer. BUG: KASAN: slab-use-after-free in xfrm6_fill_dst+0x82c/0x860 (net/ipv6/xfrm6_policy.c:86 netdev_hold()) Read of size 8 at addr ffff8880142fe588 by task exploit/153 Call Trace: xfrm6_fill_dst+0x82c/0x860 xfrm_resolve_and_create_bundle+0x21d4/0x2bd0 xfrm_lookup_with_ifid+0x485/0x1640 ip6_dst_lookup_flow+0x19b/0x1e0 udpv6_sendmsg+0x1443/0x2dd0 Fix this by reading dst->dev via dst_dev_rcu() and keeping the RCU read-side critical section active until xfrm_fill_dst() has taken the required device references.
02KernelScan AI Analysis
Risk summary
A local attacker can exploit a race condition in the XFRM/IPsec bundle creation path to trigger a use-after-free on a network device structure, potentially leading to kernel code execution or a system crash. The vulnerability is reachable by an unprivileged user who can create user namespaces to obtain the needed CAP_NET_ADMIN for the concurrent link-removal side of the race. Systems with unprivileged user namespaces disabled are not exposed to the low-privileged attack path.
Vulnerability analysis
During IPsec bundle creation, the kernel reads a network device pointer from a routing entry without holding a reference or RCU lock. A concurrent network interface removal can free that device, and the stale pointer is later dereferenced, causing a use-after-free. The fix wraps the device access in an RCU read-side critical section that remains active until all necessary device references have been acquired, preventing the device from being freed mid-operation. An unprivileged local user can trigger the send side of the race through a regular network socket; the link-removal side requires CAP_NET_ADMIN, which is obtainable inside a user namespace on systems where unprivileged user namespaces are allowed. The vulnerable path is only exercised when IPsec policies are active, though an attacker may be able to create such policies in their own network namespace.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 7.2 | 2.6.25 | 7.2.8 | 8d85d6bc9c46 |
| mainline | 2.6.25 | 7.3 | 9fa903b24b1f |
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 | Affected — no CIP fix yet (latest 6.12.114-cip34) |
| cip/6.1 | Affected — no CIP fix yet (latest 6.1.190-cip62) |
| cip/6.1-rt | Affected — no CIP fix yet (latest 6.1.189-cip61-rt32) |
| cip/5.10 | Affected — no CIP fix yet (latest 5.10.272-cip79) |
| cip/5.10-rt | Affected — no CIP fix yet (latest 5.10.272-cip79-rt35) |
| cip/4.19 | Affected — no CIP fix yet (latest 4.19.325-cip136) |
| cip/4.19-rt | Affected — no CIP fix yet (latest 4.19.325-cip136-rt50) |
| cip/4.4 | Affected — no CIP fix yet (latest 4.4.302-cip115) |
| cip/4.4-rt | Affected — no CIP fix yet (latest 4.4.302-cip115-rt63) |