ieee80211_check_concurrent_iface() points sdata->bss of an AP_VLAN at the AP with the same address and then checks the interface combinations. If that check fails, for example with -EBUSY while another AP is switching channels, ieee80211_open() returns the error with sdata->bss still set; only ieee80211_do_stop() resets it, and it does not run for an interface that never came up. Once that AP is deleted, opening the AP_VLAN again finds no AP, but sdata->bss still points to the freed one, so ieee80211_do_open() succeeds and adds the AP_VLAN to the freed AP's list: BUG: KASAN: use-after-free in ieee80211_do_open (include/linux/list.h:192 net/mac80211/iface.c:1418) Read of size 8 at addr ff11000012d51a60 by task test/118 ieee80211_do_open (include/linux/list.h:192 net/mac80211/iface.c:1418) ieee80211_open (net/mac80211/iface.c:476) __dev_open (net/core/dev.c:1764) __dev_change_flags (net/core/dev.c:10028) netif_change_flags (net/core/dev.c:10093) dev_change_flags (net/core/dev_api.c:68) devinet_ioctl (net/ipv4/devinet.c:1189) Clear sdata->bss before looking for the AP. Fixes: b6a550156bc0 ("cfg80211/mac80211: move more combination checks to mac80211") Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Kyuwon Cho --- The issue was found by an LLM-guided test generator that we are developing as a research prototype. We reproduce it with a mac80211_hwsim radio in a user and network namespace: two APs, the second one switching channels, and an AP_VLAN of the first one whose open fails with EBUSY. After both APs are deleted, the next open of the AP_VLAN succeeds and triggers the report above. With the patch, that open fails with ENOLINK and nothing shows up. The reproducer is available on request. Found and tested on mainline 9437ee8b6cf6 (v7.4-rc4-571, with KASAN); the patch applies to wireless (35c42b20ac87) as is. net/mac80211/iface.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 63a371c79183..cfeabf74451b 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -347,6 +347,9 @@ static int ieee80211_check_concurrent_iface(struct ieee80211_sub_if_data *sdata, ASSERT_RTNL(); lockdep_assert_wiphy(local->hw.wiphy); + if (iftype == NL80211_IFTYPE_AP_VLAN) + sdata->bss = NULL; + /* we hold the RTNL here so can safely walk the list */ list_for_each_entry(nsdata, &local->interfaces, list) { if (nsdata != sdata && ieee80211_sdata_running(nsdata)) { -- 2.43.0