[openwrt/openwrt] mac80211: fix flush during station removal

LEDE Commits lede-commits at lists.infradead.org
Mon Jul 8 12:17:16 PDT 2024


hauke pushed a commit to openwrt/openwrt.git, branch openwrt-23.05:
https://git.openwrt.org/bed2272605b483d1ed896c1f564c49d677eac376

commit bed2272605b483d1ed896c1f564c49d677eac376
Author: Oldřich Jedlička <oldium.pro at gmail.com>
AuthorDate: Fri Oct 6 23:37:47 2023 +0200

    mac80211: fix flush during station removal
    
    This fixes WARN_ONs when using AP_VLANs after station removal. The flush
    call passed AP_VLAN vif to driver, but because these vifs are virtual and
    not registered with drivers, we need to translate to the correct AP vif
    first.
    
    Fixes: openwrt#12420
    Signed-off-by: Oldřich Jedlička <oldium.pro at gmail.com>
    [Rename to 360-wifi-mac80211-do-not-pass-ap_vlan-vif-pointer-to-dri.patch]
    (cherry picked from commit 3e738781a9712eaa81d5af0ecc8b55cbfe480c68)
    Link: https://github.com/openwrt/openwrt/pull/15898
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 ...11-do-not-pass-ap_vlan-vif-pointer-to-dri.patch | 64 ++++++++++++++++++++++
 1 file changed, 64 insertions(+)

diff --git a/package/kernel/mac80211/patches/subsys/360-wifi-mac80211-do-not-pass-ap_vlan-vif-pointer-to-dri.patch b/package/kernel/mac80211/patches/subsys/360-wifi-mac80211-do-not-pass-ap_vlan-vif-pointer-to-dri.patch
new file mode 100644
index 0000000000..4b65ef09dc
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/360-wifi-mac80211-do-not-pass-ap_vlan-vif-pointer-to-dri.patch
@@ -0,0 +1,64 @@
+From ee0db868ee4d88493dfdc82f59e3b4e449ddddd5 Mon Sep 17 00:00:00 2001
+From: Oldřich Jedlička <oldium.pro at gmail.com>
+Date: Sat, 4 Nov 2023 15:13:33 +0100
+Subject: wifi: mac80211: do not pass AP_VLAN vif pointer to drivers during
+ flush
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+[ Upstream commit 3e3a2b645c043f7e3e488d5011478cefb69bbe8b ]
+
+This fixes WARN_ONs when using AP_VLANs after station removal. The flush
+call passed AP_VLAN vif to driver, but because these vifs are virtual and
+not registered with drivers, we need to translate to the correct AP vif
+first.
+
+Closes: https://github.com/openwrt/openwrt/issues/12420
+Fixes: 0b75a1b1e42e ("wifi: mac80211: flush queues on STA removal")
+Fixes: d00800a289c9 ("wifi: mac80211: add flush_sta method")
+Tested-by: Konstantin Demin <rockdrilla at gmail.com>
+Tested-by: Koen Vandeputte <koen.vandeputte at citymesh.com>
+Signed-off-by: Oldřich Jedlička <oldium.pro at gmail.com>
+Link: https://lore.kernel.org/r/20231104141333.3710-1-oldium.pro@gmail.com
+Signed-off-by: Johannes Berg <johannes.berg at intel.com>
+Signed-off-by: Sasha Levin <sashal at kernel.org>
+---
+ net/mac80211/driver-ops.h | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+--- a/net/mac80211/driver-ops.h
++++ b/net/mac80211/driver-ops.h
+@@ -21,7 +21,7 @@
+ static inline struct ieee80211_sub_if_data *
+ get_bss_sdata(struct ieee80211_sub_if_data *sdata)
+ {
+-	if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
++	if (sdata && sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
+ 		sdata = container_of(sdata->bss, struct ieee80211_sub_if_data,
+ 				     u.ap);
+ 
+@@ -604,10 +604,13 @@ static inline void drv_flush(struct ieee
+ 			     struct ieee80211_sub_if_data *sdata,
+ 			     u32 queues, bool drop)
+ {
+-	struct ieee80211_vif *vif = sdata ? &sdata->vif : NULL;
++	struct ieee80211_vif *vif;
+ 
+ 	might_sleep();
+ 
++	sdata = get_bss_sdata(sdata);
++	vif = sdata ? &sdata->vif : NULL;
++
+ 	if (sdata && !check_sdata_in_driver(sdata))
+ 		return;
+ 
+@@ -623,6 +626,8 @@ static inline void drv_flush_sta(struct
+ {
+ 	might_sleep();
+ 
++	sdata = get_bss_sdata(sdata);
++
+ 	if (sdata && !check_sdata_in_driver(sdata))
+ 		return;
+ 




More information about the lede-commits mailing list