[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdbpQNoh_ESB=CcUcP0_pcvDYCs9FeJ_wY74a7WJ77sLBg@mail.gmail.com>
Date: Sat, 27 Jan 2024 17:37:25 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: Kees Cook <keescook@...omium.org>
Cc: Arend van Spriel <aspriel@...il.com>, Franky Lin <franky.lin@...adcom.com>,
Hante Meuleman <hante.meuleman@...adcom.com>, Kalle Valo <kvalo@...nel.org>,
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>, 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 Fri, Jan 26, 2024 at 11:31 PM 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:
Makes perfect sense.
Reviewed-by: Linus Walleij <linus.walleij@...aro.org>
Yours,
Linus Walleij
Powered by blists - more mailing lists