linux/drivers/net/wireless/virtual
Zihan Xi e5c8d7acd3 wifi: virt_wifi: don't transfer operstate before register
virt_wifi_newlink() calls netif_stacked_transfer_operstate() before
register_netdevice(). If the lower device is dormant, that queues the
new netdev on lweventlist while it is still uninitialized. If
registration fails after that, for example because of an invalid name
such as "bad/name", free_netdev() immediately frees the object. A
later linkwatch_fire_event() then use-after-frees the list entry.

Move the transfer to after netdev_upper_dev_link(), as macvlan and
ipvlan already do.

Fixes: c7cdba31ed ("mac80211-next: rtnetlink wifi simulation device")
Reported-by: Vega <vega@nebusec.ai>
Assisted-by: LLM
Co-developed-by: Luxing Yin <root@tr0jan.top>
Signed-off-by: Luxing Yin <root@tr0jan.top>
Signed-off-by: Zihan Xi <zihanx@nebusec.ai>
Link: https://patch.msgid.link/f5a832fb0ab228ce6e2b5a91fba4ca8b79198a2f.1788948455.git.zihanx@nebusec.ai
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2026-09-14 14:48:01 +02:00
..
Kconfig
mac80211_hwsim_i.h wifi: mac80211_hwsim: implement NAN schedule callbacks 2026-05-06 11:41:50 +02:00
mac80211_hwsim_main.c wifi: mac80211_hwsim: don't hand frames to mac80211 while stopping 2026-09-09 14:51:29 +02:00
mac80211_hwsim_nan.c wifi: mac80211_hwsim: Support Tx of multicast data on NAN 2026-05-06 11:42:12 +02:00
mac80211_hwsim_nan.h wifi: mac80211_hwsim: add NAN data path TX/RX support 2026-05-06 11:41:51 +02:00
mac80211_hwsim.h wifi: mac80211_hwsim: background CAC support 2026-03-02 09:10:28 +01:00
Makefile wifi: mac80211_hwsim: split NAN handling into separate file 2026-05-05 12:10:15 +02:00
virt_wifi.c wifi: virt_wifi: don't transfer operstate before register 2026-09-14 14:48:01 +02:00