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 the 5.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: staging-rtl8192u-fix-ssid-overflow-in-r8192_wx_set_scan.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 87107518d7a93fec6cdb2559588862afeee800fb Mon Sep 17 00:00:00 2001 From: Dan Carpenter <dan.carpenter@xxxxxxxxxx> Date: Fri, 5 Mar 2021 11:12:49 +0300 Subject: staging: rtl8192u: fix ->ssid overflow in r8192_wx_set_scan() From: Dan Carpenter <dan.carpenter@xxxxxxxxxx> commit 87107518d7a93fec6cdb2559588862afeee800fb upstream. 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. Fixes: 5f53d8ca3d5d ("Staging: add rtl8192SU wireless usb driver") Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> Cc: stable <stable@xxxxxxxxxxxxxxx> Link: https://lore.kernel.org/r/YEHoAWMOSZBUw91F@mwanda Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/staging/rtl8192u/r8192U_wx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/staging/rtl8192u/r8192U_wx.c +++ b/drivers/staging/rtl8192u/r8192U_wx.c @@ -331,8 +331,10 @@ static int r8192_wx_set_scan(struct net_ 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); } } Patches currently in stable-queue which might be from dan.carpenter@xxxxxxxxxx are queue-5.10/usb-gadget-u_ether-fix-a-configfs-return-code.patch queue-5.10/tcp-fix-sign-comparison-bug-in-getsockopt-tcp_zerocopy_receive.patch queue-5.10/staging-rtl8192e-fix-possible-buffer-overflow-in-_rtl92e_wx_set_scan.patch queue-5.10/staging-rtl8188eu-fix-potential-memory-corruption-in-rtw_check_beacon_data.patch queue-5.10/staging-ks7010-prevent-buffer-overflow-in-ks_wlan_set_scan.patch queue-5.10/staging-rtl8188eu-prevent-ssid-overflow-in-rtw_wx_set_scan.patch queue-5.10/staging-rtl8712-unterminated-string-leads-to-read-overflow.patch queue-5.10/staging-rtl8192u-fix-ssid-overflow-in-r8192_wx_set_scan.patch