patch "staging: rtl8192u: fix ->ssid overflow in r8192_wx_set_scan()" added to staging-linus
Subsystems (2)
This is a note to let you know that I've just added the patch titled
staging: rtl8192u: fix ->ssid overflow in r8192_wx_set_scan()
to my staging git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
in the staging-linus branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.
If you have any questions about this process, please let me know.
From 3b897cb890d5cfb8111987b10f675525cacdab2a Mon Sep 17 00:00:00 2001
From: Dan Carpenter <[email protected]>
Date: Fri, 5 Mar 2021 11:12:49 +0300
Subject: staging: rtl8192u: fix ->ssid overflow in r8192_wx_set_scan()
We need to cap len at IW_ESSID_MAX_SIZE (32) to avoid memory corruption. This can be controlled by the user via the ioctl.
--- drivers/staging/rtl8192u/r8192U_wx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/staging/rtl8192u/r8192U_wx.c +4 -2
@@ -331,8 +331,10 @@ static int r8192_wx_set_scan(struct net_device *dev, struct iw_request_info *a,struct iw_scan_req *req = (struct iw_scan_req *)b;if (req->essid_len) { - ieee->current_network.ssid_len = req->essid_len; -memcpy (ieee->current_network.ssid, req->essid, req->essid_len); +int len =min_t (int, req->essid_len,IW_ESSID_MAX_SIZE ); + + ieee->current_network.ssid_len = len; +memcpy (ieee->current_network.ssid, req->essid, len); } }
Signature · 1 line
2.30.1