From: Thorsten Blum Date: Thu, 28 May 2026 00:10:50 +0000 (+0200) Subject: wifi: cfg80211: use strscpy in cfg80211_wext_giwname X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=23add15a3f66ace513e3b8b3f434d135d33b2e7b;p=thirdparty%2Fkernel%2Fstable.git wifi: cfg80211: use strscpy in cfg80211_wext_giwname strcpy() has been deprecated [1] because it performs no bounds checking on the destination buffer, which can lead to buffer overflows. While the current code works correctly, replace strcpy() with the safer strscpy() to follow secure coding best practices. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy Signed-off-by: Thorsten Blum Link: https://patch.msgid.link/20260528001049.1394078-2-thorsten.blum@linux.dev Signed-off-by: Johannes Berg --- diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c index c3aa56977243..5dbf3ef4b257 100644 --- a/net/wireless/wext-compat.c +++ b/net/wireless/wext-compat.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -27,7 +28,7 @@ int cfg80211_wext_giwname(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - strcpy(wrqu->name, "IEEE 802.11"); + strscpy(wrqu->name, "IEEE 802.11"); return 0; }