]> git.baikalelectronics.ru Git - kernel.git/commit
brcmfmac: firmware: Fix crash in brcm_alt_fw_path
authorPhil Elwell <phil@raspberrypi.com>
Tue, 18 Jan 2022 15:45:14 +0000 (15:45 +0000)
committerKalle Valo <kvalo@kernel.org>
Fri, 28 Jan 2022 14:06:04 +0000 (16:06 +0200)
commit122bf6e0e191335ed3f17083402adb295a6f3e60
treeab495bf6928178b2ba8b20c3adb44196620a394e
parent9a7d5153e19529ae7429e490cdcc61e4ae33b54d
brcmfmac: firmware: Fix crash in brcm_alt_fw_path

The call to brcm_alt_fw_path in brcmf_fw_get_firmwares is not protected
by a check to the validity of the fwctx->req->board_type pointer. This
results in a crash in strlcat when, for example, the WLAN chip is found
in a USB dongle.

Prevent the crash by adding the necessary check.

See: https://github.com/raspberrypi/linux/issues/4833

Fixes: f95da41dd919 ("brcmfmac: firmware: Allow per-board firmware binaries")
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220118154514.3245524-1-phil@raspberrypi.com
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c