From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: Kees Cook <kees@kernel.org>, Johannes Berg <johannes.berg@intel.com>
Cc: Chung-Hsien Hsu <chung-hsien.hsu@infineon.com>,
Chi-hsien Lin <chi-hsien.lin@infineon.com>,
James Prestwood <prestwoj@gmail.com>,
Arend van Spriel <arend.vanspriel@broadcom.com>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
Ting-Ying Li <tingying.li@cypress.com>,
linux-wireless@vger.kernel.org, brcm80211@lists.linux.dev,
brcm80211-dev-list.pdl@broadcom.com,
linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] wifi: brcmfmac: cyw: Fix __counted_by to be LE variant
Date: Mon, 21 Jul 2025 13:03:23 -0600 [thread overview]
Message-ID: <54478268-48d1-4163-9bcb-d576cc93f7ce@embeddedor.com> (raw)
In-Reply-To: <20250721181810.work.575-kees@kernel.org>
On 21/07/25 12:18, Kees Cook wrote:
> In brcmf_cyw_mgmt_tx() the "len" counter of the struct
> brcmf_mf_params_le::data flexible array is stored as little-endian via
> cpu_to_le16() so the __counted_by_le() variant must be used:
>
> struct brcmf_mf_params_le *mf_params;
> ...
> mf_params_len = offsetof(struct brcmf_mf_params_le, data) +
> (len - DOT11_MGMT_HDR_LEN);
> mf_params = kzalloc(mf_params_len, GFP_KERNEL);
> ...
> mf_params->len = cpu_to_le16(len - DOT11_MGMT_HDR_LEN);
>
> Fixes: 66f909308a7c ("wifi: brcmfmac: cyw: support external SAE authentication in station mode")
> Signed-off-by: Kees Cook <kees@kernel.org>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Thanks!
-Gustavo
> ---
> Cc: Johannes Berg <johannes.berg@intel.com>
> Cc: Chung-Hsien Hsu <chung-hsien.hsu@infineon.com>
> Cc: Chi-hsien Lin <chi-hsien.lin@infineon.com>
> Cc: James Prestwood <prestwoj@gmail.com>
> Cc: Arend van Spriel <arend.vanspriel@broadcom.com>
> Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>
> Cc: Ting-Ying Li <tingying.li@cypress.com>
> Cc: <linux-wireless@vger.kernel.org>
> Cc: <brcm80211@lists.linux.dev>
> Cc: <brcm80211-dev-list.pdl@broadcom.com>
> Cc: <linux-hardening@vger.kernel.org>
> ---
> .../net/wireless/broadcom/brcm80211/brcmfmac/cyw/fwil_types.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/fwil_types.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/fwil_types.h
> index 08c69142495a..669564382e32 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/fwil_types.h
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/fwil_types.h
> @@ -80,7 +80,7 @@ struct brcmf_mf_params_le {
> u8 da[ETH_ALEN];
> u8 bssid[ETH_ALEN];
> __le32 packet_id;
> - u8 data[] __counted_by(len);
> + u8 data[] __counted_by_le(len);
> };
>
> #endif /* CYW_FWIL_TYPES_H_ */
next prev parent reply other threads:[~2025-07-21 19:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-21 18:18 Kees Cook
2025-07-21 19:03 ` Gustavo A. R. Silva [this message]
2025-07-23 9:41 ` Arend van Spriel
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=54478268-48d1-4163-9bcb-d576cc93f7ce@embeddedor.com \
--to=gustavo@embeddedor.com \
--cc=arend.vanspriel@broadcom.com \
--cc=brcm80211-dev-list.pdl@broadcom.com \
--cc=brcm80211@lists.linux.dev \
--cc=chi-hsien.lin@infineon.com \
--cc=chung-hsien.hsu@infineon.com \
--cc=gustavoars@kernel.org \
--cc=johannes.berg@intel.com \
--cc=kees@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=prestwoj@gmail.com \
--cc=tingying.li@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
all inboxes | Powered by JetHome®