* [PATCH] wilc1000: replace deprecated strcpy() with strscpy()
@ 2025-07-05 13:48 Miguel García
2025-07-07 6:58 ` Alexis Lothoré
0 siblings, 1 reply; 3+ messages in thread
From: Miguel García @ 2025-07-05 13:48 UTC (permalink / raw)
To: linux-wireless
Cc: linux-kernel, ajay.kathat, claudiu.beznea, marex, kvalo,
alexis.lothore, skhan, Miguel García
strcpy() is deprecated for NUL-terminated strings. Replace the single
instance in wilc1000 netdev setup with strscpy(), which guarantees
NUL-termination and prevents overflow.
ndev->name is a fixed-size buffer (IFNAMSIZ, 16 bytes).
Signed-off-by: Miguel García <miguelgarciaroman8@gmail.com>
---
drivers/net/wireless/microchip/wilc1000/netdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/microchip/wilc1000/netdev.c b/drivers/net/wireless/microchip/wilc1000/netdev.c
index af298021e050..8f4d11e1a2a6 100644
--- a/drivers/net/wireless/microchip/wilc1000/netdev.c
+++ b/drivers/net/wireless/microchip/wilc1000/netdev.c
@@ -960,7 +960,7 @@ struct wilc_vif *wilc_netdev_ifc_init(struct wilc *wl, const char *name,
vif = netdev_priv(ndev);
ndev->ieee80211_ptr = &vif->priv.wdev;
- strcpy(ndev->name, name);
+ strscpy(ndev->name, name, sizeof(ndev->name));
vif->wilc = wl;
vif->ndev = ndev;
ndev->ml_priv = vif;
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] wilc1000: replace deprecated strcpy() with strscpy()
2025-07-05 13:48 [PATCH] wilc1000: replace deprecated strcpy() with strscpy() Miguel García
@ 2025-07-07 6:58 ` Alexis Lothoré
2025-08-13 14:13 ` Miguel García Román
0 siblings, 1 reply; 3+ messages in thread
From: Alexis Lothoré @ 2025-07-07 6:58 UTC (permalink / raw)
To: Miguel García, linux-wireless
Cc: linux-kernel, ajay.kathat, claudiu.beznea, marex, kvalo, skhan
Hi,
On Sat Jul 5, 2025 at 3:48 PM CEST, Miguel García wrote:
> strcpy() is deprecated for NUL-terminated strings. Replace the single
> instance in wilc1000 netdev setup with strscpy(), which guarantees
> NUL-termination and prevents overflow.
>
> ndev->name is a fixed-size buffer (IFNAMSIZ, 16 bytes).
>
> Signed-off-by: Miguel García <miguelgarciaroman8@gmail.com>
LGTM, thanks for the update
Reviewed-by: Alexis Lothoré <alexis.lothore@bootlin.com>
> ---
> drivers/net/wireless/microchip/wilc1000/netdev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/microchip/wilc1000/netdev.c b/drivers/net/wireless/microchip/wilc1000/netdev.c
> index af298021e050..8f4d11e1a2a6 100644
> --- a/drivers/net/wireless/microchip/wilc1000/netdev.c
> +++ b/drivers/net/wireless/microchip/wilc1000/netdev.c
> @@ -960,7 +960,7 @@ struct wilc_vif *wilc_netdev_ifc_init(struct wilc *wl, const char *name,
>
> vif = netdev_priv(ndev);
> ndev->ieee80211_ptr = &vif->priv.wdev;
> - strcpy(ndev->name, name);
> + strscpy(ndev->name, name, sizeof(ndev->name));
> vif->wilc = wl;
> vif->ndev = ndev;
> ndev->ml_priv = vif;
--
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] wilc1000: replace deprecated strcpy() with strscpy()
2025-07-07 6:58 ` Alexis Lothoré
@ 2025-08-13 14:13 ` Miguel García Román
0 siblings, 0 replies; 3+ messages in thread
From: Miguel García Román @ 2025-08-13 14:13 UTC (permalink / raw)
To: Alexis Lothoré
Cc: linux-wireless, linux-kernel, ajay.kathat, claudiu.beznea, marex,
kvalo, skhan
Gentle ping.
Just checking if anything else is needed for this patch.
Reviewed-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Thanks!
El lun, 7 jul 2025 a las 8:58, Alexis Lothoré
(<alexis.lothore@bootlin.com>) escribió:
>
> Hi,
>
> On Sat Jul 5, 2025 at 3:48 PM CEST, Miguel García wrote:
> > strcpy() is deprecated for NUL-terminated strings. Replace the single
> > instance in wilc1000 netdev setup with strscpy(), which guarantees
> > NUL-termination and prevents overflow.
> >
> > ndev->name is a fixed-size buffer (IFNAMSIZ, 16 bytes).
> >
> > Signed-off-by: Miguel García <miguelgarciaroman8@gmail.com>
>
> LGTM, thanks for the update
>
> Reviewed-by: Alexis Lothoré <alexis.lothore@bootlin.com>
>
> > ---
> > drivers/net/wireless/microchip/wilc1000/netdev.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/wireless/microchip/wilc1000/netdev.c b/drivers/net/wireless/microchip/wilc1000/netdev.c
> > index af298021e050..8f4d11e1a2a6 100644
> > --- a/drivers/net/wireless/microchip/wilc1000/netdev.c
> > +++ b/drivers/net/wireless/microchip/wilc1000/netdev.c
> > @@ -960,7 +960,7 @@ struct wilc_vif *wilc_netdev_ifc_init(struct wilc *wl, const char *name,
> >
> > vif = netdev_priv(ndev);
> > ndev->ieee80211_ptr = &vif->priv.wdev;
> > - strcpy(ndev->name, name);
> > + strscpy(ndev->name, name, sizeof(ndev->name));
> > vif->wilc = wl;
> > vif->ndev = ndev;
> > ndev->ml_priv = vif;
>
>
>
>
> --
> Alexis Lothoré, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-08-13 14:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-05 13:48 [PATCH] wilc1000: replace deprecated strcpy() with strscpy() Miguel García
2025-07-07 6:58 ` Alexis Lothoré
2025-08-13 14:13 ` Miguel García Román
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.