CVE-2026-143128: net: wait for in-flight device unregistrations before netns dismantle

Published Dec 3, 2026
·
Updated

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 cleanupnet() 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 netdevwaitallrefsany(), which rebroadcasts NETDEVUNREGISTER every second.

Meanwhile its netns can be dismantled: defaultdeviceexitbatch() 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:

- netdevgenlnetdeviceevent(): net->genlsock is NULL [1] - nhnetdevevent(): net->nexthop.devhash is NULL [2] - nftables netdevice notifiers: use-after-free of the nftables pernet storage [3]

but any notifier using devnet(dev) is affected, as is netdevwaitallrefsany() itself (rtnlnetlock(devnet(dev)) with CONFIGDEBUGNETSMALLRTNL=y).

This was prevented by rtnllockunregistering() until I removed it in commit 8a4fc54b07d7 ("net: get rid of rtnllockunregistering()"), considering only the loopback dependency, and missing the notifiers one.

Restore a per-netns counter of devices sitting in netdevruntodo(), and make defaultdeviceexitbatch() 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 initnet, then delete X. Without this patch, the nexthopflushdev() null-ptr-deref from [2] triggers. With it, no splat; netns churn and dismantle of a netns whose own device is held still work.

[1] https://lore.kernel.org/netdev/6adf9f64.6200f071.51519.0ed1.GAE@google.com/ [2] https://lore.kernel.org/netdev/20261105114707.3030737-1-bsdhenrymartin@gmail.com/ [3] https://lore.kernel.org/netdev/20261105114817.3033625-1-bsdhenrymartin@gmail.com/

Affected Software

1 affected component
Linux Linux kernel

Event History

Dec 3, 2026
CVE Published
via MITRE·09:19 AM
Data Sourced
via MITRE·09:19 AM
Description

Frequently Asked Questions

1

What conditions are required for the flaw to be triggered?

A network device must be unregistered from a context other than cleanup of its own network namespace, such as deletion of a veth peer in another namespace. References must remain held on the device so that unregistration waits and repeatedly rebroadcasts NETDEV_UNREGISTER while the device's namespace is dismantled.

2

Which kernel components can be affected?

Any network-device notifier that uses dev_net(dev) can run against torn-down per-network-namespace state or freed memory. Reported examples include generic netlink, nexthop device handling, and nf_tables netdevice notifiers.

3

How might an affected system present?

Observed failures include net->genl_sock being NULL in netdev_genl_netdevice_event(), net->nexthop.devhash being NULL in nh_netdev_event(), and use-after-free of nf_tables per-network-namespace storage. With CONFIG_DEBUG_NET_SMALL_RTNL enabled, netdev_wait_allrefs_any() can also access the dismantled namespace through __rtnl_net_lock(dev_net(dev)).

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203