CVE-2026-143348: ipv6: fix fib6 walker UAF on NLM_F_REPLACE
In the Linux kernel, the following vulnerability has been resolved:
ipv6: fix fib6 walker UAF on NLMFREPLACE
fib6walker uses w->leaf to remember the next fib6info to dump, so an RTMGETROUTE dump can continue there on the next recvmsg(). This assumes that whoever removes a route from the tree also updates the walkers pointing at it. fib6delroute() does: it moves w->leaf to the next route. The NLMFREPLACE branch of fib6addrt2node() does not: it removes the old route, fib6add() frees it, and w->leaf keeps pointing at the freed object.
The fnsernum version check in fib6dumptable() normally protects against resuming on a stale w->leaf, but it can be bypassed: ip6linkfailure() resets fnsernum to -1 when the default route fails, which an unprivileged user in a user+net namespace can cause:
1) link failure fnsernum = -1 2) dump pauses on route R 3) replace R fnsernum changed, R freed 4) link failure fnsernum = -1 5) dump resumes -1 == -1, reads freed R <- UAF
BUG: KASAN: slab-use-after-free in rt6fillnode+0x1c22/0x2cd0 Read of size 4 at addr ff11000011fa0064 by task poc/101 rt6fillnode <- rt6dumproute
Fix by adjusting walkers separately for replacement and deletion. For replacement, add fib6walkersreplaceleaf() points w->leaf at the new route. For deletion and ECMP sibling removal, fib6walkersskiprt() calls fib6walkersreplaceleaf() with the next route. Reset w->skipinnode when updating w->leaf, and set w->state to FWSU when no next route remains.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.120 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.66 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.7 - Compensating control
Adjust IPv6 fib6 walker handling separately for route replacement and deletion: for NLM_F_REPLACE, use fib6_walkers_replace_leaf() to point w->leaf at the new route and reset w->skip_in_node; set w->state to FWS_U when no next route remains. Ensure deletion and ECMP sibling removal advance walkers to the next route.
Event History
Frequently Asked Questions
What sequence is required to trigger the use-after-free?
An RTM_GETROUTE dump must pause while its walker references a route, that route must then be replaced with NLM_F_REPLACE and freed, and a subsequent link failure must reset the serial number so the dump resumes using the stale route pointer. The described sequence includes link failures both before the dump pauses and after the route replacement.
Can an unprivileged user participate in triggering the required conditions?
Yes. An unprivileged user in a user and network namespace can cause the default-route link failure that resets the relevant serial number to -1. The data does not state what privileges are required to replace the route.
What evidence may indicate that this issue has been triggered?
The reported failure is a KASAN slab-use-after-free read in rt6_fill_node, reached through rt6_dump_route during route dumping. The freed object is a fib6_info route referenced by a stale fib6 walker leaf pointer.
What does the fix change?
The fix adjusts fib6 walkers for route replacement separately from normal route deletion, preventing a walker from retaining a pointer to the replaced and freed route.