ipv6: fix use-after-free in ip6_finish_output2()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ e415ed3a4b8b246ee5e9d109ff5153efcf96b9f2 · < 3dc98e5fe82d069dd29b124ffbdb679331dfea43| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ipv6: fix use-after-free in ip6_finish_output2()
ip6_finish_output2() caches a pointer to the IPv6 destination address (daddr) before invoking lwtunnel_xmit(). The LWT-BPF transmit path or other encapsulation operations within lwtunnel_xmit() can reallocate the skb head, freeing the memory that daddr points to. When lwtunnel_xmit() returns LWTUNNEL_XMIT_CONTINUE, the function continues to use the stale daddr pointer to compute the nexthop and to look up or create the neighbour entry. This results in a use-after-free read, which can leak sensitive kernel data, pollute the neighbour table with arbitrary values, misdirect traffic, or crash the system.
Fix this by re-fetching the IPv6 header and the destination address pointer after lwtunnel_xmit() returns LWTUNNEL_XMIT_CONTINUE, ensuring that the subsequent nexthop computation and neighbour lookup operate on valid memory.
From the CVE record · Linux
The Linux kernel's IPv6 output path can read freed memory if an LWT-BPF transmit path or other encapsulation operation reallocates a packet buffer and transmission continues. This can expose sensitive kernel data, corrupt neighbour entries, misdirect traffic, or crash the system. The input does not specify attacker access or authentication requirements.
Engineers running Linux kernels with the affected IPv6 output code should check their kernel versions against the vendor advisory; affected versions were not provided.