wl1251: Fix possible buffer overflow in wl1251_cmd_scan
authorLee Gibson <leegib@gmail.com>
Wed, 28 Apr 2021 11:55:08 +0000 (12:55 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jul 2021 07:44:50 +0000 (09:44 +0200)
commitc5e4a10d7bd5d4f419d8b9705dff60cf69b302a1
tree14dae98c629f4333eacfa25e4ee7e0d9e1459cab
parent5a3d373c4a3370cefc93c269084c761717fb1558
wl1251: Fix possible buffer overflow in wl1251_cmd_scan

[ Upstream commit d10a87a3535cce2b890897914f5d0d83df669c63 ]

Function wl1251_cmd_scan calls memcpy without checking the length.
Harden by checking the length is within the maximum allowed size.

Signed-off-by: Lee Gibson <leegib@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210428115508.25624-1-leegib@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/ti/wl1251/cmd.c