summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau2024-10-02 10:38:32 +0000
committerFelix Fietkau2024-10-02 10:39:34 +0000
commita9540a4e33599c01f0c1547d3e29d73fcd73d0ea (patch)
tree795343a2198c2bbd2145feac4cf115d2a930580f
parent123cb3793fb1bf86df8173d620d05a6169db56fc (diff)
downloadopenwrt-a9540a4e33599c01f0c1547d3e29d73fcd73d0ea.tar.gz
mac80211: do not pass a stopped vif to the driver on get_txpower
Fixes potential crashes in various drivers when checking the status of interfaces that are down Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--package/kernel/mac80211/patches/subsys/321-wifi-mac80211-do-not-pass-a-stopped-vif-to-the-drive.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/subsys/321-wifi-mac80211-do-not-pass-a-stopped-vif-to-the-drive.patch b/package/kernel/mac80211/patches/subsys/321-wifi-mac80211-do-not-pass-a-stopped-vif-to-the-drive.patch
new file mode 100644
index 0000000000..f48fa38e5e
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/321-wifi-mac80211-do-not-pass-a-stopped-vif-to-the-drive.patch
@@ -0,0 +1,24 @@
+From: Felix Fietkau <nbd@nbd.name>
+Date: Wed, 2 Oct 2024 11:45:35 +0200
+Subject: [PATCH] wifi: mac80211: do not pass a stopped vif to the driver in
+ .get_txpower
+
+Avoid potentially crashing in the driver because of uninitialized private data
+
+Fixes: 5b3dc42b1b0d ("mac80211: add support for driver tx power reporting")
+Cc: stable@vger.kernel.org
+Signed-off-by: Felix Fietkau <nbd@nbd.name>
+---
+
+--- a/net/mac80211/cfg.c
++++ b/net/mac80211/cfg.c
+@@ -3134,7 +3134,8 @@ static int ieee80211_get_tx_power(struct
+ struct ieee80211_local *local = wiphy_priv(wiphy);
+ struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
+
+- if (local->ops->get_txpower)
++ if (local->ops->get_txpower &&
++ (sdata->flags & IEEE80211_SDATA_IN_DRIVER))
+ return drv_get_txpower(local, sdata, dbm);
+
+ if (local->emulate_chanctx)