mwifiex: Fix possible buffer overflows at parsing bss descriptor
authorTakashi Iwai <tiwai@suse.de>
Wed, 29 May 2019 12:52:19 +0000 (14:52 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 21 Jul 2019 07:05:52 +0000 (09:05 +0200)
commit58ec3690a908494f7a7c3e8a302eb491bef9d979
treeba4cc28e2b9bf00174d1eb14210399c703bda219
parent2bf0723fbf03d38db7cbe1ad16d0a26f5929f216
mwifiex: Fix possible buffer overflows at parsing bss descriptor

[ Upstream commit 13ec7f10b87f5fc04c4ccbd491c94c7980236a74 ]

mwifiex_update_bss_desc_with_ie() calls memcpy() unconditionally in
a couple places without checking the destination size.  Since the
source is given from user-space, this may trigger a heap buffer
overflow.

Fix it by putting the length check before performing memcpy().

This fix addresses CVE-2019-3846.

Reported-by: huangwen <huangwen@venustech.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/marvell/mwifiex/scan.c