mwifiex: Abort at too short BSS descriptor element
authorTakashi Iwai <tiwai@suse.de>
Wed, 29 May 2019 12:52:20 +0000 (14:52 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 21 Jul 2019 07:04:32 +0000 (09:04 +0200)
commitebd45bdd74ffe4e199e5af39b4d7765059419a9c
treef178f6756ec48afedf63e0c1a569698a5b27d584
parentd30cb648f3ec77ca5f773a9b74d565cca1561aa1
mwifiex: Abort at too short BSS descriptor element

commit 685c9b7750bfacd6fc1db50d86579980593b7869 upstream.

Currently mwifiex_update_bss_desc_with_ie() implicitly assumes that
the source descriptor entries contain the enough size for each type
and performs copying without checking the source size.  This may lead
to read over boundary.

Fix this by putting the source size check in appropriate places.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/marvell/mwifiex/scan.c