* [PATCH v2] hamradio: baycom: replace strcpy() with strscpy()
@ 2025-01-20 0:34 Ethan Carter Edwards
2025-01-20 7:40 ` Dan Carpenter
0 siblings, 1 reply; 3+ messages in thread
From: Ethan Carter Edwards @ 2025-01-20 0:34 UTC (permalink / raw)
To: Jakub Kicinski
Cc: t.sailer, linux-kernel, netdev, linux-hams, pabeni, Dan Carpenter
The strcpy() function has been deprecated and replaced with strscpy().
There is an effort to make this change treewide:
https://github.com/KSPP/linux/issues/88.
Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com>
---
v2: reduce verbosity
Link to v1: https://lore.kernel.org/lkml/bqKL4XKDGLWNih2jsEzZYpBSHG6Ux5mLZfDBIgHckEUxDq4l4pPgQPEXEqKRE7pUwMrXZBVeko9aYr1w_E5h5r_R_YFA46G8dGhV1id7zy4=@ethancedwards.com/
drivers/net/hamradio/baycom_par.c | 4 ++--
drivers/net/hamradio/baycom_ser_fdx.c | 2 +-
drivers/net/hamradio/baycom_ser_hdx.c | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/hamradio/baycom_par.c b/drivers/net/hamradio/baycom_par.c
index 00ebc25d0b22..47bc74d3ad8c 100644
--- a/drivers/net/hamradio/baycom_par.c
+++ b/drivers/net/hamradio/baycom_par.c
@@ -427,7 +427,7 @@ static int baycom_ioctl(struct net_device *dev, void __user *data,
break;
case HDLCDRVCTL_GETMODE:
- strcpy(hi->data.modename, bc->options ? "par96" : "picpar");
+ strscpy(hi->data.modename, bc->options ? "par96" : "picpar");
if (copy_to_user(data, hi, sizeof(struct hdlcdrv_ioctl)))
return -EFAULT;
return 0;
@@ -439,7 +439,7 @@ static int baycom_ioctl(struct net_device *dev, void __user *data,
return baycom_setmode(bc, hi->data.modename);
case HDLCDRVCTL_MODELIST:
- strcpy(hi->data.modename, "par96,picpar");
+ strscpy(hi->data.modename, "par96,picpar");
if (copy_to_user(data, hi, sizeof(struct hdlcdrv_ioctl)))
return -EFAULT;
return 0;
diff --git a/drivers/net/hamradio/baycom_ser_fdx.c b/drivers/net/hamradio/baycom_ser_fdx.c
index 799f8ece7824..3dda6b215fe3 100644
--- a/drivers/net/hamradio/baycom_ser_fdx.c
+++ b/drivers/net/hamradio/baycom_ser_fdx.c
@@ -531,7 +531,7 @@ static int baycom_ioctl(struct net_device *dev, void __user *data,
return baycom_setmode(bc, hi->data.modename);
case HDLCDRVCTL_MODELIST:
- strcpy(hi->data.modename, "ser12,ser3,ser24");
+ strscpy(hi->data.modename, "ser12,ser3,ser24");
if (copy_to_user(data, hi, sizeof(struct hdlcdrv_ioctl)))
return -EFAULT;
return 0;
diff --git a/drivers/net/hamradio/baycom_ser_hdx.c b/drivers/net/hamradio/baycom_ser_hdx.c
index 5d1ab4840753..4f058f61659e 100644
--- a/drivers/net/hamradio/baycom_ser_hdx.c
+++ b/drivers/net/hamradio/baycom_ser_hdx.c
@@ -570,7 +570,7 @@ static int baycom_ioctl(struct net_device *dev, void __user *data,
break;
case HDLCDRVCTL_GETMODE:
- strcpy(hi->data.modename, "ser12");
+ strscpy(hi->data.modename, "ser12");
if (bc->opt_dcd <= 0)
strcat(hi->data.modename, (!bc->opt_dcd) ? "*" : (bc->opt_dcd == -2) ? "@" : "+");
if (copy_to_user(data, hi, sizeof(struct hdlcdrv_ioctl)))
@@ -584,7 +584,7 @@ static int baycom_ioctl(struct net_device *dev, void __user *data,
return baycom_setmode(bc, hi->data.modename);
case HDLCDRVCTL_MODELIST:
- strcpy(hi->data.modename, "ser12");
+ strscpy(hi->data.modename, "ser12");
if (copy_to_user(data, hi, sizeof(struct hdlcdrv_ioctl)))
return -EFAULT;
return 0;
--
2.47.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] hamradio: baycom: replace strcpy() with strscpy()
2025-01-20 0:34 [PATCH v2] hamradio: baycom: replace strcpy() with strscpy() Ethan Carter Edwards
@ 2025-01-20 7:40 ` Dan Carpenter
2025-01-20 7:43 ` Ethan Carter Edwards
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2025-01-20 7:40 UTC (permalink / raw)
To: Ethan Carter Edwards
Cc: Jakub Kicinski, t.sailer, linux-kernel, netdev, linux-hams, pabeni
On Sun, Jan 19, 2025 at 07:34:51PM -0500, Ethan Carter Edwards wrote:
> The strcpy() function has been deprecated and replaced with strscpy().
> There is an effort to make this change treewide:
> https://github.com/KSPP/linux/issues/88.
>
> Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com>
> ---
> v2: reduce verbosity
If you had resent this patch a week ago we would have happily merged it.
But now you've hit the merge window and you'll need to wait until
6.14-rc1 or -rc2 have been released and then rebase it on net-next again
and resend it.
Anyway, if you do resend it feel free to add a:
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
regards,
dan carpenter
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] hamradio: baycom: replace strcpy() with strscpy()
2025-01-20 7:40 ` Dan Carpenter
@ 2025-01-20 7:43 ` Ethan Carter Edwards
0 siblings, 0 replies; 3+ messages in thread
From: Ethan Carter Edwards @ 2025-01-20 7:43 UTC (permalink / raw)
To: Dan Carpenter
Cc: Jakub Kicinski, t.sailer, linux-kernel, netdev, linux-hams, pabeni
On 25/01/20 10:40AM, Dan Carpenter wrote:
> On Sun, Jan 19, 2025 at 07:34:51PM -0500, Ethan Carter Edwards wrote:
> > The strcpy() function has been deprecated and replaced with strscpy().
> > There is an effort to make this change treewide:
> > https://github.com/KSPP/linux/issues/88.
> >
> > Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com>
> > ---
> > v2: reduce verbosity
>
> If you had resent this patch a week ago we would have happily merged it.
> But now you've hit the merge window and you'll need to wait until
> 6.14-rc1 or -rc2 have been released and then rebase it on net-next again
> and resend it.
I see. My apologies. High school started back for me last week, so I was
busy getting situated with my classes and all. I'll keep this in mind
and send it back out in a week or two.
Thanks,
Ethan
>
> Anyway, if you do resend it feel free to add a:
>
> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
>
> regards,
> dan carpenter
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-01-20 7:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-20 0:34 [PATCH v2] hamradio: baycom: replace strcpy() with strscpy() Ethan Carter Edwards
2025-01-20 7:40 ` Dan Carpenter
2025-01-20 7:43 ` Ethan Carter Edwards
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®