mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 15:12:13 +02:00
wifi: brcmfmac: cyw: Fix __counted_by to be LE variant
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: 66f909308a ("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>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>>
Link: https://patch.msgid.link/20250721181810.work.575-kees@kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
708243c62e
commit
204bb85286
|
|
@ -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_ */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user