Re: [PATCH wireless] wifi: brcmfmac: fix join parameter length in IBSS join

From: Arend van Spriel

Date: Tue Nov 24 2026 - 15:14:14 EST


On Sat, 21 Nov 2026 09:27:54 +0000, Chad Aldreda <ca@xxxxxxxxxxxxxx> wrote:
> brcmf_cfg80211_join_ibss() builds the length of the SET_SSID payload in
> steps. It starts with the SSID record (36 bytes), adds
> BRCMF_ASSOC_PARAMS_FIXED_SIZE (14) when a BSSID is given, and adds
> sizeof(join_params.params_le) (16) when the channel is fixed. With both a
> BSSID and a fixed channel the result is 66, but struct brcmf_join_params
> is 52 bytes (sizes as on x86-64, where __le32 is 4-byte aligned). The
> length is passed unchanged to the protocol layer, which copies that many
> bytes from the on-stack record (brcmf_proto_bcdc_msg(),
> brcmf_msgbuf_tx_ioctl()), so 14 bytes of kernel stack beyond it are sent
> to the firmware.
>
> When the channel is fixed the whole record is in use whether or not a
> BSSID was given, so set the length to sizeof(join_params) in that branch.
> The other three cases (36, 50 and 52 bytes) are unchanged.
>
> The double count dates from the commit that added this calculation: the
> BSSID case counted WL_ASSOC_PARAMS_FIXED_SIZE, and the existing
> wl_ch_to_chanspec(), which that commit called after the BSSID case,
> added WL_ASSOC_PARAMS_FIXED_SIZE plus one chanspec again.
>
> Fixes: 69274f020a92 ("staging: brcm80211: Fixed ibss join/leave functionality in brcmfmac driver")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Chad Aldreda <ca@xxxxxxxxxxxxxx>
> ---

[...]

> drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Arend van Spriel <arend.vanspriel@xxxxxxxxxxxx>

Regards,
Arend