[openwrt/openwrt] mac80211: avoid crashing on invalid band info

LEDE Commits lede-commits at lists.infradead.org
Mon Jan 8 17:09:57 PST 2024


blocktrron pushed a commit to openwrt/openwrt.git, branch openwrt-23.05:
https://git.openwrt.org/3bf602d740765db52d96733d172093a4b9a69915

commit 3bf602d740765db52d96733d172093a4b9a69915
Author: David Bauer <mail at david-bauer.net>
AuthorDate: Thu Nov 30 07:32:52 2023 +0100

    mac80211: avoid crashing on invalid band info
    
    Frequent crashes have been observed on MT7916 based platforms. While the
    root of these crashes are currently unknown, they happen when decoding
    rate information of connected STAs in AP mode. The rate-information is
    associated with a band which is not available on the PHY.
    
    Check for this condition in order to avoid crashing the whole system.
    This patch should be removed once the roout cause has been found and
    fixed.
    
    Link: https://github.com/freifunk-gluon/gluon/issues/2980
    
    Signed-off-by: David Bauer <mail at david-bauer.net>
    (cherry picked from commit 1278d47beaabaa963b2956e81936269b7fea4003)
---
 .../subsys/780-avoid-crashing-missing-band.patch   | 34 ++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/package/kernel/mac80211/patches/subsys/780-avoid-crashing-missing-band.patch b/package/kernel/mac80211/patches/subsys/780-avoid-crashing-missing-band.patch
new file mode 100644
index 0000000000..2bc11efd00
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/780-avoid-crashing-missing-band.patch
@@ -0,0 +1,34 @@
+From: David Bauer <mail at david-bauer.net>
+Date: Thu, 30 Nov 2023 07:32:52 +0100
+Subject: [PATCH] mac80211: avoid crashing on invalid band info
+
+Frequent crashes have been observed on MT7916 based platforms. While the
+root of these crashes are currently unknown, they happen when decoding
+rate information of connected STAs in AP mode. The rate-information is
+associated with a band which is not available on the PHY.
+
+Check for this condition in order to avoid crashing the whole system.
+This patch should be removed once the roout cause has been found and
+fixed.
+
+Link: https://github.com/freifunk-gluon/gluon/issues/2980
+
+Signed-off-by: David Bauer <mail at david-bauer.net>
+---
+
+--- a/net/mac80211/sta_info.c
++++ b/net/mac80211/sta_info.c
+@@ -2422,6 +2422,13 @@ static void sta_stats_decode_rate(struct
+ 
+ 		sband = local->hw.wiphy->bands[band];
+ 
++		if (!sband) {
++			wiphy_warn(local->hw.wiphy,
++				    "Invalid band %d\n",
++				    band);
++			break;
++		}
++
+ 		if (WARN_ON_ONCE(!sband->bitrates))
+ 			break;
+ 




More information about the lede-commits mailing list