HIGH
net/ipv6 Tunnel UAF
CVE-2026-46120
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI6.6MEDIUM
01Description
In the Linux kernel, the following vulnerability has been resolved: ip6_gre: Use cached t->net in ip6erspan_changelink(). After commit 5e72ce3e3980 ("net: ipv6: Use link netns in newlink() of rtnl_link_ops"), ip6erspan_newlink() correctly resolves the per-netns ip6gre hash via link_net. ip6erspan_changelink() was not converted in that series and still uses dev_net(dev), which diverges from the device's creation netns after IFLA_NET_NS_FD migration. This re-inserts the tunnel into the wrong per-netns hash. The original netns keeps a stale entry. When that netns is later destroyed, ip6gre_exit_rtnl_net() walks the stale entry, producing a slab-use-after-free reported by KASAN, followed by a kernel BUG at net/core/dev.c (LIST_POISON1) in unregister_netdevice_many_notify(). Reachable from an unprivileged user namespace (unshare --user --map-root-user --net). ip6gre_changelink() earlier in the same file already uses the cached t->net; only ip6erspan_changelink() has the wrong shape.
02KernelScan AI Analysis
Risk summary
Local attackers with user namespace capabilities can trigger a use-after-free in IPv6 GRE tunnel management, leading to potential information disclosure, memory corruption, and kernel crashes. The vulnerability is reachable from unprivileged user namespaces and affects systems with IPv6 GRE tunneling enabled.
Vulnerability analysis
The ip6erspan_changelink() function incorrectly uses dev_net(dev) instead of the cached t->net when reinserting tunnels into per-netns hash tables after IFLA_NET_NS_FD namespace migration. This creates stale entries in the original namespace that cause a slab-use-after-free when the namespace is later destroyed. The stale entry traversal reads freed heap memory—potentially disclosing slab contents and corrupting memory—before hitting a kernel BUG at LIST_POISON1 in unregister_netdevice_many_notify(). ip6gre_changelink() already uses the cached t->net; only ip6erspan_changelink() was missed in the original conversion.
03Fix Versions
| Branch | Fixed in | Patch commit |
|---|---|---|
| 4.17 | 4.17 | 7bd0f2b162b4 |
| 5.10 | 5.10.258 | 01b71ff2857d |
| 5.15 | 5.15.209 | 0fcf6731706f |
| 6.1 | 6.1.175 | eca62bb0569d |
| 6.12 | 6.12.88 | e70cfb40c3a9 |
| 6.18 | 6.18.30 | cf7fc624329e |
| 6.6 | 6.6.140 | 311fdd26eb44 |
| 7.0 | 7.0.7 | 1d324c2f43f7 |
| mainline | 7.1-rc3 | — |