This is a note to let you know that I've just added the patch titled staging: rtl8712: unterminated string leads to read overflow 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-rtl8712-unterminated-string-leads-to-read-overflow.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 d660f4f42ccea50262c6ee90c8e7ad19a69fb225 Mon Sep 17 00:00:00 2001 From: Dan Carpenter <dan.carpenter@xxxxxxxxxx> Date: Wed, 24 Feb 2021 11:45:59 +0300 Subject: staging: rtl8712: unterminated string leads to read overflow From: Dan Carpenter <dan.carpenter@xxxxxxxxxx> commit d660f4f42ccea50262c6ee90c8e7ad19a69fb225 upstream. The memdup_user() function does not necessarily return a NUL terminated string so this can lead to a read overflow. Switch from memdup_user() to strndup_user() to fix this bug. Fixes: c6dc001f2add ("staging: r8712u: Merging Realtek's latest (v2.6.6). Various fixes.") Cc: stable <stable@xxxxxxxxxxxxxxx> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> Link: https://lore.kernel.org/r/YDYSR+1rj26NRhvb@mwanda Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c +++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c @@ -924,7 +924,7 @@ static int r871x_wx_set_priv(struct net_ struct iw_point *dwrq = (struct iw_point *)awrq; len = dwrq->length; - ext = memdup_user(dwrq->pointer, len); + ext = strndup_user(dwrq->pointer, len); if (IS_ERR(ext)) return PTR_ERR(ext); 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