public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
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 1/2] wifi: b43: fix infinite loop from invalid hardware DMA RX slot
Date: Thu, 16 Apr 2026 18:31:00 +0200	[thread overview]
Message-ID: <20260416183100.154ca989@barney> (raw)
In-Reply-To: <CAOiHx=nuUvf31J5khj4e4Kzv2wK4++TeZevXu3Z53qB66RagdQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1066 bytes --]

On Thu, 16 Apr 2026 08:34:00 +0200
Jonas Gorski <jonas.gorski@gmail.com> wrote:

> > diff --git a/drivers/net/wireless/broadcom/b43/dma.c b/drivers/net/wireless/broadcom/b43/dma.c
> > index XXXXXXX..XXXXXXX 100644
> > --- a/drivers/net/wireless/broadcom/b43/dma.c
> > +++ b/drivers/net/wireless/broadcom/b43/dma.c
> > @@ -1693,7 +1693,10 @@ void b43_dma_rx(struct b43_dmaring *ring)
> >         B43_WARN_ON(ring->tx);
> >         current_slot = ops->get_current_rxslot(ring);
> > -       B43_WARN_ON(!(current_slot >= 0 && current_slot < ring->nr_slots));
> > +       if (!(current_slot >= 0 && current_slot < ring->nr_slots)) {
> > +               B43_WARN_ON(1);
> > +               return;
> > +       }  
> 
> B43_WARN_ON() returns the condition's result, so you can shorten this to
> 
> if (B43_WARN_ON(!(current_slot >= 0 && current_slot < ring->nr_slots)))
>         return;


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 --]

  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 [this message]
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

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=20260416183100.154ca989@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