OSDN Git Service

mwifiex: Prevent memory corruption handling keys
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 8 Jul 2020 11:58:57 +0000 (14:58 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:14:57 +0000 (08:14 +0200)
commitdaa69a213f038f4dafb4feda19db9d135b5ce308
tree97aff7a3f0e01aa050e1ef1f94480eb6d4a040c8
parent96867800fc148f854ec34641c976ff5bcf8c8dd7
mwifiex: Prevent memory corruption handling keys

[ Upstream commit e18696786548244914f36ec3c46ac99c53df99c3 ]

The length of the key comes from the network and it's a 16 bit number.  It
needs to be capped to prevent a buffer overflow.

Fixes: 5e6e3a92b9a4 ("wireless: mwifiex: initial commit for Marvell mwifiex driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Ganapathi Bhat <ganapathi.bhat@nxp.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200708115857.GA13729@mwanda
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c