CVE-2026-99320: ipv6: raw: fix use-after-free in rawv6_send_hdrinc()
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
ipv6: raw: fix use-after-free in rawv6_send_hdrinc()
rawv6_send_hdrinc() caches the route before handing the skb to l3mdev_ip6_out(). The VRF output path may replace skb->dst and release the original route, leaving the cached pointer stale.
The function later dereferences that pointer for statistics accounting and as the output device passed to NF_HOOK(). Its RCU read-side critical section starts after l3mdev_ip6_out(), so it cannot prevent the old route from being reclaimed in between.
Reload the route from the current skb destination after l3mdev_ip6_out() returns.
KASAN reports a slab-use-after-free in rawv6_sendmsg(), with the route allocated by ip6_dst_alloc(), freed by dst_destroy() from rcu_core(), and the related RCU callback queued from vrf_l3_out().
The Linux kernel CVE team has assigned CVE-2026-99320 to this issue.
Affected and fixed versions
===========================
Issue introduced in 4.9 with commit 4c1feac58e06270321cc500b85c2d94a11495775 and fixed in 6.12.118 with commit afb69c90cf62b630bf74c82d7bcfca840db8b076 Issue introduced in 4.9 with commit 4c1feac58e06270321cc500b85c2d94a11495775 and fixed in 6.18.64 with commit 3fda55b34d8f1621676f1238728c16033dff1148 Issue introduced in 4.9 with commit 4c1feac58e06270321cc500b85c2d94a11495775 and fixed in 7.3.5 with commit 18772182967f9a0160dc7ada43311eab87c3d9ec Issue introduced in 4.9 with commit 4c1feac58e06270321cc500b85c2d94a11495775 and fixed in 7.4-rc2 with commit 66dfb2cacda7faae614d688943d85e75abf7f586
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-99320
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
net/ipv6/raw.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/afb69c90cf62b630bf74c82d7bcfca840db8b076 https://git.kernel.org/stable/c/3fda55b34d8f1621676f1238728c16033dff1148 https://git.kernel.org/stable/c/18772182967f9a0160dc7ada43311eab87c3d9ec https://git.kernel.org/stable/c/66dfb2cacda7faae614d688943d85e75abf7f586