Re: wifi: mac80211: make n_channels updated absolutely before accessing channels[]
From: Johannes Berg
Date: Wed Nov 12 2025 - 07:13:55 EST
On Wed, 2025-11-12 at 16:50 +0800, xu.xin16@xxxxxxxxxx wrote:
> > > From: xu xin <xu.xin16@xxxxxxxxxx>
> > >
> > > The commit 2663d0462eb3 ("wifi: mac80211: Avoid address calculations via out of
> > > bounds array indexing") said that req->n_channels must be set before
> > > req->channels[] can be used. But there's still the case that req.channels
> > > accessing was prior to n_channels++.
> > >
> > > This does not fix any visible bug, just making n_channels updated before
> > > accessing channels[] absolutely, to avoid potential UBSAN out of indexing
> > > warning.
> >
> > I reverted the annotations, so this isn't necessary.
>
> Excuse me, what is the annotations you reverted ? Maybe I missed somthing.
You missed multiple things, for example the fact that your changes do
nothing.
Please, everyone, don't submit changes when you don't understand _both_
the original code (at least mostly) and your "own" changes.
Otherwise we'll just think you used an LLM to cause us work and never
take you seriously again.
johannes