kernel_samsung_a53x/drivers/net/wireless
Alper Nebi Yasak fa21ee65e2 wifi: mwifiex: Fix memcpy() field-spanning write warning in mwifiex_config_scan()
[ Upstream commit d241a139c2e9f8a479f25c75ebd5391e6a448500 ]

Replace one-element array with a flexible-array member in `struct
mwifiex_ie_types_wildcard_ssid_params` to fix the following warning
on a MT8173 Chromebook (mt8173-elm-hana):

[  356.775250] ------------[ cut here ]------------
[  356.784543] memcpy: detected field-spanning write (size 6) of single field "wildcard_ssid_tlv->ssid" at drivers/net/wireless/marvell/mwifiex/scan.c:904 (size 1)
[  356.813403] WARNING: CPU: 3 PID: 742 at drivers/net/wireless/marvell/mwifiex/scan.c:904 mwifiex_scan_networks+0x4fc/0xf28 [mwifiex]

The "(size 6)" above is exactly the length of the SSID of the network
this device was connected to. The source of the warning looks like:

    ssid_len = user_scan_in->ssid_list[i].ssid_len;
    [...]
    memcpy(wildcard_ssid_tlv->ssid,
           user_scan_in->ssid_list[i].ssid, ssid_len);

There is a #define WILDCARD_SSID_TLV_MAX_SIZE that uses sizeof() on this
struct, but it already didn't account for the size of the one-element
array, so it doesn't need to be changed.

Fixes: 5e6e3a92b9a4 ("wireless: mwifiex: initial commit for Marvell mwifiex driver")
Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Acked-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/20241007222301.24154-1-alpernebiyasak@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-12-17 13:24:05 +01:00
..
admtek
ath wifi: ath10k: fix invalid VHT parameters in supported_vht_mcs_rate_nss2 2024-12-17 13:24:04 +01:00
atmel
broadcom Revert "wifi: brcmsmac: advertise MFP_CAPABLE to enable WPA3" 2024-11-24 00:23:42 +01:00
cisco
cnss2
cnss_genl
cnss_prealloc
cnss_utils
intel Revert "wifi: iwlwifi: abort scan when rfkill on but device enabled" 2024-11-24 00:23:53 +01:00
intersil wifi: p54: Use IRQF_NO_AUTOEN flag in request_irq() 2024-12-17 13:24:03 +01:00
marvell wifi: mwifiex: Fix memcpy() field-spanning write warning in mwifiex_config_scan() 2024-12-17 13:24:05 +01:00
mediatek Revert "wifi: mt76: mt7915: fix rx filter setting for bfee functionality" 2024-11-24 00:23:30 +01:00
microchip Revert "wifi: wilc1000: fix potential RCU dereference issue in wilc_parse_join_bss_param" 2024-11-24 00:23:30 +01:00
qualcomm/qca6490
quantenna wireless: Remove redundant 'flush_workqueue()' calls 2024-11-19 08:44:44 +01:00
ralink
realtek Revert "wifi: rtw88: always wait for both firmware loading attempts" 2024-11-24 00:23:31 +01:00
rsi
scsc
st Revert "wifi: cw1200: Avoid processing an invalid TIM IE" 2024-11-24 00:23:53 +01:00
ti
zydas
Kconfig
mac80211_hwsim.c
mac80211_hwsim.h
Makefile
ray_cs.c
ray_cs.h
rayctl.h
rndis_wlan.c wireless: Remove redundant 'flush_workqueue()' calls 2024-11-19 08:44:44 +01:00
virt_wifi.c Revert "wifi: virt_wifi: avoid reporting connection success with wrong SSID" 2024-11-24 00:23:56 +01:00
wl3501.h
wl3501_cs.c