From: "Michael Büsch" <m@bues.ch>
To: Jonas Gorski <jonas.gorski@gmail.com>
Cc: Tristan Madani <tristmd@gmail.com>,
Johannes Berg <johannes@sipsolutions.net>,
linux-wireless@vger.kernel.org, b43-dev@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] wifi: b43: fix OOB read from hardware key index in b43_rx()
Date: Thu, 16 Apr 2026 18:35:54 +0200 [thread overview]
Message-ID: <20260416183554.7add6b06@barney> (raw)
In-Reply-To: <CAOiHx=kpVH3jq_XuDKp==13yNx1AMcvVaRe4R2-bScOo5otMaA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1122 bytes --]
On Thu, 16 Apr 2026 08:34:11 +0200
Jonas Gorski <jonas.gorski@gmail.com> wrote:
> > diff --git a/drivers/net/wireless/broadcom/b43/xmit.c b/drivers/net/wireless/broadcom/b43/xmit.c
> > index XXXXXXX..XXXXXXX 100644
> > --- a/drivers/net/wireless/broadcom/b43/xmit.c
> > +++ b/drivers/net/wireless/broadcom/b43/xmit.c
> > @@ -704,7 +704,10 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr)
> > */
> > keyidx = b43_kidx_to_raw(dev, keyidx);
> > - B43_WARN_ON(keyidx >= ARRAY_SIZE(dev->key));
> > + if (keyidx >= ARRAY_SIZE(dev->key)) {
> > + b43dbg(dev->wl, "RX: invalid key index %u\n", keyidx);
> > + goto drop;
> > + }
>
> B43_WARN_ON() returns the condition's result, so if you keep it you
> can shorten this to
>
> if (B43_WARN_ON(keyidx >= ARRAY_SIZE(dev->key)))
> goto drop;
Acked-by: Michael Büsch <m@bues.ch>
Please also check the b43legacy driver. It may contain exactly the same code.
--
Michael Büsch
https://bues.ch/
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2026-04-16 16:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-15 22:24 [PATCH v2 0/2] wifi: b43: fix OOB read and infinite loop from hardware-reported values Tristan Madani
2026-04-15 22:24 ` [PATCH v2 1/2] wifi: b43: fix infinite loop from invalid hardware DMA RX slot Tristan Madani
2026-04-16 6:34 ` Jonas Gorski
2026-04-16 16:31 ` Michael Büsch
2026-04-15 22:24 ` [PATCH v2 2/2] wifi: b43: fix OOB read from hardware key index in b43_rx() Tristan Madani
2026-04-16 6:34 ` Jonas Gorski
2026-04-16 16:35 ` Michael Büsch [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260416183554.7add6b06@barney \
--to=m@bues.ch \
--cc=b43-dev@lists.infradead.org \
--cc=johannes@sipsolutions.net \
--cc=jonas.gorski@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=tristmd@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox