[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210717155145.15041-1-len.baker@gmx.com>
Date: Sat, 17 Jul 2021 17:51:45 +0200
From: Len Baker <len.baker@....com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Len Baker <len.baker@....com>,
Pavel Skripkin <paskripkin@...il.com>,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: [PATCH] staging/rtl8712: Remove all strcpy() uses in favor of strscpy()
strcpy() performs no bounds checking on the destination buffer. This
could result in linear overflows beyond the end of the buffer, leading
to all kinds of misbehaviors. The safe replacement is strscpy().
Signed-off-by: Len Baker <len.baker@....com>
---
drivers/staging/rtl8712/os_intfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8712/os_intfs.c b/drivers/staging/rtl8712/os_intfs.c
index 2214aca09730..9502f6aa5306 100644
--- a/drivers/staging/rtl8712/os_intfs.c
+++ b/drivers/staging/rtl8712/os_intfs.c
@@ -203,7 +203,7 @@ struct net_device *r8712_init_netdev(void)
if (!pnetdev)
return NULL;
if (dev_alloc_name(pnetdev, ifname) < 0) {
- strcpy(ifname, "wlan%d");
+ strscpy(ifname, "wlan%d", sizeof(ifname));
dev_alloc_name(pnetdev, ifname);
}
padapter = netdev_priv(pnetdev);
--
2.25.1
Powered by blists - more mailing lists