[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Fri, 2 Feb 2024 19:08:46 +0100
From: Arend Van Spriel <aspriel@...il.com>
To: Kalle Valo <kvalo@...nel.org>
Cc: Kees Cook <keescook@...omium.org>, Franky Lin <franky.lin@...adcom.com>,
Hante Meuleman <hante.meuleman@...adcom.com>,
Chi-hsien Lin <chi-hsien.lin@...ineon.com>, Ian Lin <ian.lin@...ineon.com>,
Johannes Berg <johannes.berg@...el.com>,
Wright Feng <wright.feng@...ress.com>, Hector Martin <marcan@...can.st>,
linux-wireless@...r.kernel.org, brcm80211-dev-list.pdl@...adcom.com,
"Gustavo A. R. Silva" <gustavoars@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>,
Jisoo Jang <jisoo.jang@...sei.ac.kr>, Hans de Goede <hdegoede@...hat.com>,
Aloka Dixit <quic_alokad@...cinc.com>, John Keeping <john@...ping.me.uk>,
Jeff Johnson <quic_jjohnson@...cinc.com>, linux-kernel@...r.kernel.org,
linux-hardening@...r.kernel.org
Subject: Re: [PATCH] wifi: brcmfmac: Adjust n_channels usage for __counted_by
On 2/2/2024 11:34 AM, Kalle Valo wrote:
> Arend Van Spriel <aspriel@...il.com> writes:
>
>> On 2/2/2024 10:58 AM, Arend Van Spriel wrote:
>>
>>> On 2/1/2024 11:04 AM, Kalle Valo wrote:
>>>> Kees Cook <keescook@...omium.org> wrote:
>>>>
>>>>> After commit e3eac9f32ec0 ("wifi: cfg80211: Annotate struct
>>>>> cfg80211_scan_request with __counted_by"), the compiler may enforce
>>>>> dynamic array indexing of req->channels to stay below n_channels. As a
>>>>> result, n_channels needs to be increased _before_ accessing the newly
>>>>> added array index. Increment it first, then use "i" for the prior index.
>>>>> Solves this warning in the coming GCC that has __counted_by support:
>>>>>
>>>>> ../drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c: In
>>>>> function 'brcmf_internal_escan_add_info':
>>>>> ../drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:3783:46: warning: operation on 'req->
>>>>> n_channels' may be undefined [-Wsequence-point]
>>>>> 3783 | req->channels[req->n_channels++] = chan;
>>>>> | ~~~~~~~~~~~~~~~^~
>>>>>
>>>>> Fixes: e3eac9f32ec0 ("wifi: cfg80211: Annotate struct
>>>>> cfg80211_scan_request with __counted_by")
>>>>> Cc: Arend van Spriel <aspriel@...il.com>
>>>>> Cc: Franky Lin <franky.lin@...adcom.com>
>>>>> Cc: Hante Meuleman <hante.meuleman@...adcom.com>
>>>>> Cc: Kalle Valo <kvalo@...nel.org>
>>>>> Cc: Chi-hsien Lin <chi-hsien.lin@...ineon.com>
>>>>> Cc: Ian Lin <ian.lin@...ineon.com>
>>>>> Cc: Johannes Berg <johannes.berg@...el.com>
>>>>> Cc: Wright Feng <wright.feng@...ress.com>
>>>>> Cc: Hector Martin <marcan@...can.st>
>>>>> Cc: linux-wireless@...r.kernel.org
>>>>> Cc: brcm80211-dev-list.pdl@...adcom.com
>>>>> Signed-off-by: Kees Cook <keescook@...omium.org>
>>>>> Reviewed-by: Hans de Goede <hdegoede@...hat.com>
>>>>> Reviewed-by: Linus Walleij <linus.walleij@...aro.org>
>>>>> Reviewed-by: Gustavo A. R. Silva <gustavoars@...nel.org>
>>>>
>>>> I'm planning to queue this for wireless tree. Arend, ack?
>>> This slipped past my broadcom email. As the Fixes commit is in 6.7 I
>>> would say ACK.
>
> Thanks.
>
>> Cc: to stable?
>
> Is commit e3eac9f32ec0 in stable releases? (I don't follow stable and
> don't know what commits they take.) I propose that as we have Fixes tag
> let's not add cc but instead let stable maintainers to decide.
I confirmed the commit was in 6.7 and the latest released kernel is
always handled by stable kernel team. kernel.org main page always shows
the active stable/longterm releases. That said I have no problem with
your proposal.
Gr. AvS
Powered by blists - more mailing lists