ip6_gre: Use cached t->net in ip6erspan_changelink().
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 2d665034f239412927b1e71329f20f001c92da09 · < e70cfb40c3a99b232cd42c6a6a10f0d8e039dc82| No fix yet |
| Linux Linux |
|
|
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.
From the CVE record · Linux
The Linux kernel’s ip6erspan_changelink() can place a tunnel in the wrong network-namespace hash after namespace migration. When the original namespace is destroyed, a stale entry can trigger a use-after-free and kernel BUG. The issue is reachable from an unprivileged user namespace.
Administrators running the Linux kernel should check their versions against the vendor advisory; affected versions are not specified in the input.