Thread (1 message) 1 message, 1 author, 2020-12-08

Re: [PATCH 1/1] mwifiex: Fix possible buffer overflows in mwifiex_config_scan

From: Kalle Valo <hidden>
Date: 2020-12-08 14:30:28
Also in: linux-wireless, lkml

Xiaohui Zhang [off-list ref] writes:
quoted hunk
From: Zhang Xiaohui <redacted>

mwifiex_config_scan() calls memcpy() without checking
the destination size may trigger a buffer overflower,
which a local user could use to cause denial of service
or the execution of arbitrary code.
Fix it by putting the length check before calling memcpy().

Signed-off-by: Zhang Xiaohui <redacted>
---
 drivers/net/wireless/marvell/mwifiex/scan.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/marvell/mwifiex/scan.c b/drivers/net/wireless/marvell/mwifiex/scan.c
index c2a685f63..b1d90678f 100644
--- a/drivers/net/wireless/marvell/mwifiex/scan.c
+++ b/drivers/net/wireless/marvell/mwifiex/scan.c
@@ -930,6 +930,8 @@ mwifiex_config_scan(struct mwifiex_private *priv,
 				    "DIRECT-", 7))
 				wildcard_ssid_tlv->max_ssid_length = 0xfe;
 
+			if (ssid_len > 1)
+				ssid_len = 1;
 			memcpy(wildcard_ssid_tlv->ssid,
 			       user_scan_in->ssid_list[i].ssid, ssid_len);
min_t()?

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help