PT-2026-166986
CVE-2026-143128
·
Published
2026-12-03
·
Updated
2026-12-03
Description by
Score
N/A
Not availableNo severity ratings or metrics are available. When they are, we'll update the corresponding info on the page.
In the Linux kernel, the following vulnerability has been resolved:
net: wait for in-flight device unregistrations before netns dismantle
A device can be unregistered by a context other than the cleanup net()
of its own netns, for instance a veth whose peer in another netns is
deleted. If references on it are still held, it stays in
netdev wait allrefs any(), which rebroadcasts NETDEV UNREGISTER every
second.
Meanwhile its netns can be dismantled: default device exit batch()
only takes care of devices still listed in the netns, then pernet exit
handlers free their state, and finally struct net is freed while the
device still points to it.
The rebroadcasts then run notifiers against torn down pernet state, or
freed memory. Three instances were reported so far:
- netdev genl netdevice event(): net->genl sock is NULL [1]
- nh netdev event(): net->nexthop.devhash is NULL [2]
- nf tables netdevice notifiers: use-after-free of the nftables pernet storage [3]
but any notifier using dev net(dev) is affected, as is
netdev wait allrefs any() itself ( rtnl net lock(dev net(dev)) with
CONFIG DEBUG NET SMALL RTNL=y).
This was prevented by rtnl lock unregistering() until I removed it
in commit 8a4fc54b07d7 ("net: get rid of rtnl lock unregistering()"),
considering only the loopback dependency, and missing the notifiers one.
Restore a per-netns counter of devices sitting in netdev run todo(),
and make default device exit batch() wait for it to reach zero, after
it has unregistered all devices of the dying netns(es). At this point
no new unregistration can be started for these netns.
Unlike the old barrier, this only waits for devices of the netns being
dismantled and runs after their own devices are gone.
Tested on a KASAN kernel with a debug-only hack holding a reference
on a veth device for 5 seconds after its unregistration: a nexthop
on the veth in netns X, delete its peer from init net, then delete X.
Without this patch, the nexthop flush dev() null-ptr-deref from [2]
triggers. With it, no splat; netns churn and dismantle of a netns
whose own device is held still work.
Found an issue in the description? Have something to add? Feel free to write us 👾