{"id":"CVE-2026-139105","aliases":["CVE-2026-139105"],"related":[],"kind":"vulnerability","state":"published","title":"netdev-genl: ignore NETDEV_UNREGISTER rebroadcasts","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nnetdev-genl: ignore NETDEV_UNREGISTER rebroadcasts\n\nnetdev_wait_allrefs_any() re-sends NETDEV_UNREGISTER every second while\nit waits for the last references on a device to be dropped. By then\nnetdev_run_todo() has already marked the device NETREG_UNREGISTERED and\nRTNL has been dropped at least once since the initial notification sent\nby unregister_netdevice_many_notify().\n\nnetdev_genl_netdevice_event() does not tell these rebroadcasts apart\nfrom the initial notification and sends a NETDEV_CMD_DEV_DEL_NTF\nmulticast for each of them. At best this spams NETDEV_NLGRP_MGMT\nlisteners with duplicate notifications; at worst the pernet state of\nthe netns the device belongs to is already gone and the handler\ndereferences a NULL pointer.\n\ndefault_device_exit_batch() only unregisters the devices still listed\nin the exiting netns; it does not wait for in-flight unregistrations of\ndevices that were already unlisted (the barrier doing that was removed\nby commit 8a4fc54b07d7 (\"net: get rid of rtnl_lock_unregistering()\")).\nSo when a device is unregistered by something other than the\ncleanup_net() of its own netns while references on it are still held,\ne.g. a veth whose peer in another netns gets deleted, and that netns\nexits while the device is stuck in netdev_wait_allrefs_any(), the\nremaining pernet exit handlers run and genl_pernet_exit() sets\nnet->genl_sock to NULL. The next rebroadcast then crashes in\ngenl_has_listeners():\n\n  BUG: KASAN: null-ptr-deref in netlink_has_listeners+0x3d/0x3f0 net/netlink/af_netlink.c:1388\n  Read of size 8 at addr 0000000000000578 by task syz.0.0/5325\n  Call Trace:\n   <TASK>\n   netlink_has_listeners+0x3d/0x3f0 net/netlink/af_netlink.c:1388\n   genl_has_listeners include/net/genetlink.h:644 [inline]\n   netdev_genl_dev_notify+0x161/0x450 net/core/netdev-genl.c:93\n   netdev_genl_netdevice_event+0x98/0x3c0 net/core/netdev-genl.c:1491\n   notifier_call_chain+0x1a5/0x3d0 kernel/notifier.c:85\n   netdev_wait_allrefs_any net/core/dev.c:11690 [inline]\n   netdev_run_todo+0x731/0x1060 net/core/dev.c:11808\n   rtnl_unlock net/core/rtnetlink.c:157 [inline]\n   rtnl_dellink+0x68f/0x810 net/core/rtnetlink.c:3707\n\nsyzbot hit this by moving one end of a veth pair into a short-lived\nnetns while netdevsim's deferred FIB event processing still held a\nreference on it, and then deleting the other end (repro [1]). While the\nsource of this bug is netdevsim deferring FIB processing for and holding\nonto the device reference for O(seconds) which is being fixed\nseparately [2], any driver may introduce such a delay and trigger the\nnull-ptr-deref.\n\nSkip the rebroadcasts, which are the only NETDEV_UNREGISTER events\ndelivered with reg_state == NETREG_UNREGISTERED. The notifications sent\nby unregister_netdevice_many_notify() and, for a device leaving a netns,\nby __dev_change_net_namespace() are issued under RTNL in the same\ncritical section that unlists the device, before its netns can be torn\ndown, and keep being handled. This mirrors what ip6_route_dev_notify()\nalready does to cope with the rebroadcasts.\n\nThis change should not break the UAPI spec as it defines dev-del-ntf as\na \"Notification about device disappearing.\" which is a single event. The\nrebroadcast in netdev_wait_allrefs_any() exists to re-kick in-kernel\nsubsystems holding references; netdev-genl happens to be on the notifier\nchain and forwards it.\n\n[1] https://gist.github.com/NamanGulati/2d1b49b8757f9a88b0bd6e55018c02ae\n[2] https://lore.kernel.org/r/20261023191517.607834-1-kuniyu@google.com","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nnetdev-genl: ignore NETDEV_UNREGISTER rebroadcasts\n\nnetdev_wait_allrefs_any() re-sends NETDEV_UNREGISTER every second while\nit waits for the last references on a device to be dropped. By then\nnetdev_run_todo() has already marked the device NETREG_UNREGISTERED and\nRTNL has been dropped at least once since the initial notification sent\nby unregister_netdevice_many_notify().\n\nnetdev_genl_netdevice_event() does not tell these rebroadcasts apart\nfrom the initial notification and sends a NETDEV_CMD_DEV_DEL_NTF\nmulticast for each of them. At best this spams NETDEV_NLGRP_MGMT\nlisteners with duplicate notifications; at worst the pernet state of\nthe netns the device belongs to is already gone and the handler\ndereferences a NULL pointer.\n\ndefault_device_exit_batch() only unregisters the devices still listed\nin the exiting netns; it does not wait for in-flight unregistrations of\ndevices that were already unlisted (the barrier doing that was removed\nby commit 8a4fc54b07d7 (\"net: get rid of rtnl_lock_unregistering()\")).\nSo when a device is unregistered by something other than the\ncleanup_net() of its own netns while references on it are still held,\ne.g. a veth whose peer in another netns gets deleted, and that netns\nexits while the device is stuck in netdev_wait_allrefs_any(), the\nremaining pernet exit handlers run and genl_pernet_exit() sets\nnet->genl_sock to NULL. The next rebroadcast then crashes in\ngenl_has_listeners():\n\n  BUG: KASAN: null-ptr-deref in netlink_has_listeners+0x3d/0x3f0 net/netlink/af_netlink.c:1388\n  Read of size 8 at addr 0000000000000578 by task syz.0.0/5325\n  Call Trace:\n   <TASK>\n   netlink_has_listeners+0x3d/0x3f0 net/netlink/af_netlink.c:1388\n   genl_has_listeners include/net/genetlink.h:644 [inline]\n   netdev_genl_dev_notify+0x161/0x450 net/core/netdev-genl.c:93\n   netdev_genl_netdevice_event+0x98/0x3c0 net/core/netdev-genl.c:1491\n   notifier_call_chain+0x1a5/0x3d0 kernel/notifier.c:85\n   netdev_wait_allrefs_any net/core/dev.c:11690 [inline]\n   netdev_run_todo+0x731/0x1060 net/core/dev.c:11808\n   rtnl_unlock net/core/rtnetlink.c:157 [inline]\n   rtnl_dellink+0x68f/0x810 net/core/rtnetlink.c:3707\n\nsyzbot hit this by moving one end of a veth pair into a short-lived\nnetns while netdevsim's deferred FIB event processing still held a\nreference on it, and then deleting the other end (repro [1]). While the\nsource of this bug is netdevsim deferring FIB processing for and holding\nonto the device reference for O(seconds) which is being fixed\nseparately [2], any driver may introduce such a delay and trigger the\nnull-ptr-deref.\n\nSkip the rebroadcasts, which are the only NETDEV_UNREGISTER events\ndelivered with reg_state == NETREG_UNREGISTERED. The notifications sent\nby unregister_netdevice_many_notify() and, for a device leaving a netns,\nby __dev_change_net_namespace() are issued under RTNL in the same\ncritical section that unlists the device, before its netns can be torn\ndown, and keep being handled. This mirrors what ip6_route_dev_notify()\nalready does to cope with the rebroadcasts.\n\nThis change should not break the UAPI spec as it defines dev-del-ntf as\na \"Notification about device disappearing.\" which is a single event. The\nrebroadcast in netdev_wait_allrefs_any() exists to re-kick in-kernel\nsubsystems holding references; netdev-genl happens to be on the notifier\nchain and forwards it.\n\n[1] https://gist.github.com/NamanGulati/2d1b49b8757f9a88b0bd6e55018c02ae\n[2] https://lore.kernel.org/r/20261023191517.607834-1-kuniyu@google.com","source":"cvelist"}],"published":"2026-11-30T13:31:37.530Z","modified":"2026-11-30T14:18:19.067Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"d3d854fd6a1d97157f790604e07f6386e8df8fe4","fixed":"7af6433b10582713f762a3c04cb00355805033f7","status":"affected"},{"type":"git","introduced":"d3d854fd6a1d97157f790604e07f6386e8df8fe4","fixed":"adf47f2babc5f6e6536640f5fd20c11c51058399","status":"affected"},{"type":"git","introduced":"d3d854fd6a1d97157f790604e07f6386e8df8fe4","fixed":"85780eacecdbe095c1ba4f3659d2cdfcc69d5ca9","status":"affected"},{"type":"git","introduced":"d3d854fd6a1d97157f790604e07f6386e8df8fe4","fixed":"fd0909e963ed8f36967bd072ed484be7babe46de","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.3","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.3","status":"unaffected"},{"type":"semver","introduced":"6.12.120","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.65","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.3.6","lastAffected":"7.3.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.4-rc1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/7af6433b10582713f762a3c04cb00355805033f7","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/adf47f2babc5f6e6536640f5fd20c11c51058399","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/85780eacecdbe095c1ba4f3659d2cdfcc69d5ca9","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/fd0909e963ed8f36967bd072ed484be7babe46de","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-139105","url":"https://www.cve.org/CVERecord?id=CVE-2026-139105","licence":"CVE Terms of Use","modified":"2026-11-30T13:31:37.530Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-139105","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-139105","licence":"Public domain","modified":"2026-11-30T14:18:19.067Z"}],"updatedAt":"2026-11-30T14:32:35.132Z","epss":{"score":0.00353,"percentile":0.31038,"date":"2026-12-01T12:00:22.000Z"}}