public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/2] wifi: b43: enforce bounds check on firmware key index in b43_rx()
@ 2026-04-17 11:11 Tristan Madani
  2026-04-17 11:11 ` [PATCH v3 2/2] wifi: b43legacy: enforce bounds check on firmware key index in RX path Tristan Madani
  0 siblings, 1 reply; 2+ messages in thread
From: Tristan Madani @ 2026-04-17 11:11 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes, jonas.gorski, m, b43-dev, stable

From: Tristan Madani <tristan@talencesecurity.com>

The firmware-controlled key index in b43_rx() can exceed the dev->key[]
array size (58 entries). The existing B43_WARN_ON is non-enforcing in
production builds, allowing an out-of-bounds read.

Make the B43_WARN_ON check enforcing by dropping the frame when the
firmware returns an invalid key index.

Suggested-by: Jonas Gorski <jonas.gorski@gmail.com>
Acked-by: Michael Büsch <m@bues.ch>
Fixes: e4d6b7951812 ("[B43]: add mac80211-based driver for modern BCM43xx devices")
Cc: stable@vger.kernel.org
Signed-off-by: Tristan Madani <tristan@talencesecurity.com>
---
 drivers/net/wireless/broadcom/b43/xmit.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/broadcom/b43/xmit.c b/drivers/net/wireless/broadcom/b43/xmit.c
index 7651b1bdb..f0b082596 100644
--- a/drivers/net/wireless/broadcom/b43/xmit.c
+++ b/drivers/net/wireless/broadcom/b43/xmit.c
@@ -702,7 +702,8 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr)
 		 * key index, but the ucode passed it slightly different.
 		 */
 		keyidx = b43_kidx_to_raw(dev, keyidx);
-		B43_WARN_ON(keyidx >= ARRAY_SIZE(dev->key));
+		if (B43_WARN_ON(keyidx >= ARRAY_SIZE(dev->key)))
+			goto drop;
 
 		if (dev->key[keyidx].algorithm != B43_SEC_ALGO_NONE) {
 			wlhdr_len = ieee80211_hdrlen(fctl);
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-04-17 11:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-17 11:11 [PATCH v3 1/2] wifi: b43: enforce bounds check on firmware key index in b43_rx() Tristan Madani
2026-04-17 11:11 ` [PATCH v3 2/2] wifi: b43legacy: enforce bounds check on firmware key index in RX path Tristan Madani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox