KernelScan.io

HIGH Introduced in 5.10

xfrm AllocSPI UAF

CVE-2026-98370

CVSS 7.0 / 10.0 KernelScan AI

CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H

01

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.

02

Engine v0.7.0

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.

Affectednet/xfrm/xfrm_user.c (xfrm/IPsec netlink)

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.

03

BranchIntroducedFixed inPatch commit
5.105.105.10.271494f2bee9d8d
5.155.105.15.22217893987e529
6.15.106.1.18942971ea17c7a
6.125.106.12.112bb63ab52a182
6.185.106.18.54248433942155
6.65.106.6.1582b63341e2ebc
7.25.107.2.8e70f639aee2f
mainline5.107.3d1ebd9081879
cip/5.105.105.10.271-cip78494f2bee9d8d
cip/5.10-rt5.105.10.272-cip79-rt35494f2bee9d8d
cip/6.15.106.1.189-cip6142971ea17c7a
cip/6.1-rt5.106.1.189-cip61-rt3242971ea17c7a
cip/6.125.106.12.112-cip33bb63ab52a182

04

State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.

CIP treeState
cip/6.12Fixed in 6.12.112-cip33
cip/6.1Fixed in 6.1.189-cip61
cip/6.1-rtFixed in 6.1.189-cip61-rt32
cip/5.10Fixed in 5.10.271-cip78
cip/5.10-rtFixed in 5.10.272-cip79-rt35