HIGH Introduced in 3.15
xfrm InputState UAF
CVE-2026-98229
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI8.1HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: xfrm: save input state data before secpath resets xfrm_input() stores the current xfrm_state in the skb secpath while it continues receive-side processing. Some input paths can reset that secpath before xfrm_input() has finished dereferencing the state. Receive callback users such as VTI and XFRM interfaces can reset the secpath. The VTI receive path does so before checking whether the packet crosses network namespaces, while the XFRM interface path does so only for cross-network-namespace packets. The XFRM_MAX_DEPTH error path can also reset the secpath before the final drop callback reports the current state's protocol. If secpath_reset() drops the last state reference while the state is concurrently deleted, xfrm_input() can still dereference the freed state when selecting transport_finish() or reporting the drop callback protocol. Save the state protocol on the stack while the state is still valid, and use the already saved address family for transport_finish(). A larval XFRM_STATE_ACQ state has no type, so retain nexthdr as its protocol. This preserves the existing drop-path fallback while avoiding the post-reset state dereferences without adding an extra state reference to every received packet.
02KernelScan AI Analysis
Risk summary
Systems running IPsec (XFRM) with VTI or XFRM interfaces are vulnerable to a use-after-free in the receive path when a security path reset races with concurrent state deletion. A remote attacker who can send IPsec packets to such a system may achieve kernel memory corruption, potentially leading to code execution or denial of service. The cross-namespace handling paths make containerized deployments with IPsec particularly exposed.
Vulnerability analysis
The XFRM receive path stores the current IPsec state in the packet's security path and continues processing, but certain callback paths — VTI, XFRM interfaces, and the maximum-depth error path — can reset that security path before the receive function has finished using the state. If the state's last reference is dropped during that reset while the state is concurrently deleted, the receive function dereferences freed memory when reporting the protocol or selecting the transport handler. The fix saves the protocol and address family on the stack while the state is still valid, eliminating any further dereference of the state object after a security path reset. This bug is reachable from the network by any attacker who can send IPsec packets to a system with configured XFRM states; cross-namespace packet handling in containerized environments widens the attack surface.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.12 | 3.15 | 6.12.112 | 35de97850987 |
| 6.18 | 3.15 | 6.18.54 | 148db154066b |
| 7.2 | 3.15 | 7.2.8 | 537a5ae18b2b |
| mainline | 3.15 | 7.3-rc4 | 3cf5cdecd99c |