public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arend Van Spriel <aspriel@gmail.com>
To: Kalle Valo <kvalo@kernel.org>, Kees Cook <keescook@chromium.org>
Cc: Franky Lin <franky.lin@broadcom.com>,
	Hante Meuleman <hante.meuleman@broadcom.com>,
	Chi-hsien Lin <chi-hsien.lin@infineon.com>,
	Ian Lin <ian.lin@infineon.com>,
	Johannes Berg <johannes.berg@intel.com>,
	Wright Feng <wright.feng@cypress.com>,
	Hector Martin <marcan@marcan.st>,
	linux-wireless@vger.kernel.org,
	brcm80211-dev-list.pdl@broadcom.com,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Jisoo Jang <jisoo.jang@yonsei.ac.kr>,
	Hans de Goede <hdegoede@redhat.com>,
	Aloka Dixit <quic_alokad@quicinc.com>,
	John Keeping <john@keeping.me.uk>,
	Jeff Johnson <quic_jjohnson@quicinc.com>,
	linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH] wifi: brcmfmac: Adjust n_channels usage for __counted_by
Date: Fri, 2 Feb 2024 11:00:51 +0100	[thread overview]
Message-ID: <d4855223-4323-43f1-9a29-e279e2cb128c@gmail.com> (raw)
In-Reply-To: <a91c6a28-6762-41cf-bb85-09e79f3d29d4@gmail.com>

On 2/2/2024 10:58 AM, Arend Van Spriel wrote:
> On 2/1/2024 11:04 AM, Kalle Valo wrote:
>> Kees Cook <keescook@chromium.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@gmail.com>
>>> Cc: Franky Lin <franky.lin@broadcom.com>
>>> Cc: Hante Meuleman <hante.meuleman@broadcom.com>
>>> Cc: Kalle Valo <kvalo@kernel.org>
>>> Cc: Chi-hsien Lin <chi-hsien.lin@infineon.com>
>>> Cc: Ian Lin <ian.lin@infineon.com>
>>> Cc: Johannes Berg <johannes.berg@intel.com>
>>> Cc: Wright Feng <wright.feng@cypress.com>
>>> Cc: Hector Martin <marcan@marcan.st>
>>> Cc: linux-wireless@vger.kernel.org
>>> Cc: brcm80211-dev-list.pdl@broadcom.com
>>> Signed-off-by: Kees Cook <keescook@chromium.org>
>>> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
>>> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>>> Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.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.

Cc: to stable?

Gr. AvS


  reply	other threads:[~2024-02-02 10:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-26 22:31 [PATCH] wifi: brcmfmac: Adjust n_channels usage for __counted_by Kees Cook
2024-01-27 13:15 ` Hans de Goede
2024-01-27 16:37 ` Linus Walleij
2024-01-27 17:00 ` Gustavo A. R. Silva
2024-02-01 10:04 ` Kalle Valo
2024-02-02  9:58   ` Arend Van Spriel
2024-02-02 10:00     ` Arend Van Spriel [this message]
2024-02-02 10:34       ` Kalle Valo
2024-02-02 18:08         ` Arend Van Spriel
2024-02-02 16:45 ` Kalle Valo

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=d4855223-4323-43f1-9a29-e279e2cb128c@gmail.com \
    --to=aspriel@gmail.com \
    --cc=brcm80211-dev-list.pdl@broadcom.com \
    --cc=chi-hsien.lin@infineon.com \
    --cc=franky.lin@broadcom.com \
    --cc=gustavoars@kernel.org \
    --cc=hante.meuleman@broadcom.com \
    --cc=hdegoede@redhat.com \
    --cc=ian.lin@infineon.com \
    --cc=jisoo.jang@yonsei.ac.kr \
    --cc=johannes.berg@intel.com \
    --cc=john@keeping.me.uk \
    --cc=keescook@chromium.org \
    --cc=kvalo@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=marcan@marcan.st \
    --cc=quic_alokad@quicinc.com \
    --cc=quic_jjohnson@quicinc.com \
    --cc=wright.feng@cypress.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