HIGH Introduced in 5.10
xfrm AllocSPI UAF
CVE-2026-98370
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: fix compat ALLOCSPI request use-after-free xfrm_state_netlink() builds the ALLOCSPI response with dump_one_state(), which already calls alloc_compat() with the response skb and header. xfrm_alloc_userspi() then calls alloc_compat() again, but passes the original request skb and its header. For a compat request, the translator therefore interprets the 228-byte compat xfrm_userspi_info as the 232-byte native layout and reads four bytes past the declared payload. It also publishes the translated child through the request's frag_list. A multicast clone of the request shares skb_shared_info and can observe that child. xfrm_user_rcv_msg() frees it after the request handler returns, racing a compat receiver which may still be copying from it and resulting in a use-after-free. Remove the redundant conversion. The response keeps its correct compat translation from dump_one_state(), and no child is attached to the inbound request.
02KernelScan AI Analysis
Risk summary
A local unprivileged attacker on a system with the XFRM/IPsec netlink subsystem can trigger a use-after-free in the compat (32-bit) ALLOCSPI request path by racing a multicast receiver against the request teardown. Successful exploitation of the heap use-after-free could yield kernel memory disclosure or corruption, up to privilege escalation or a system crash. The bug requires a compat (32-bit) process issuing XFRM_MSG_ALLOCSPI netlink requests, which is permitted for unprivileged users.
Vulnerability analysis
When a 32-bit (compat) process sends an XFRM_MSG_ALLOCSPI request over netlink, the kernel redundantly runs the compat translator a second time on the inbound request, misreading the smaller compat request layout as the larger native one and attaching a translated copy to the request buffer. A multicast clone of that request shares the same underlying buffer metadata, so a listener can still be copying from the attached copy at the moment the kernel frees it after the request handler returns, producing a use-after-free that a racing local process can exploit. The fix removes the redundant second translation, so the response keeps its single correct compat translation and nothing is attached to the inbound request that could be freed while still in use. Any local user can reach this path by sending ALLOCSPI netlink messages from a 32-bit process; no special capabilities are required, and the vulnerable code is compiled in whenever the XFRM subsystem is enabled.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 5.10 | 5.10 | 5.10.271 | 494f2bee9d8d |
| 5.15 | 5.10 | 5.15.222 | 17893987e529 |
| 6.1 | 5.10 | 6.1.189 | 42971ea17c7a |
| 6.12 | 5.10 | 6.12.112 | bb63ab52a182 |
| 6.18 | 5.10 | 6.18.54 | 248433942155 |
| 6.6 | 5.10 | 6.6.158 | 2b63341e2ebc |
| 7.2 | 5.10 | 7.2.8 | e70f639aee2f |
| mainline | 5.10 | 7.3 | d1ebd9081879 |
| cip/5.10 | 5.10 | 5.10.271-cip78 | 494f2bee9d8d |
| cip/5.10-rt | 5.10 | 5.10.272-cip79-rt35 | 494f2bee9d8d |
| cip/6.1 | 5.10 | 6.1.189-cip61 | 42971ea17c7a |
| cip/6.1-rt | 5.10 | 6.1.189-cip61-rt32 | 42971ea17c7a |
| cip/6.12 | 5.10 | 6.12.112-cip33 | bb63ab52a182 |
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 |
| cip/6.1 | Fixed in 6.1.189-cip61 |
| cip/6.1-rt | Fixed in 6.1.189-cip61-rt32 |
| cip/5.10 | Fixed in 5.10.271-cip78 |
| cip/5.10-rt | Fixed in 5.10.272-cip79-rt35 |