* [PATCH] MIPS: BCM63XX: Replace strcpy() with strscpy() in board_prom_init()
@ 2025-04-22 7:42 Thorsten Blum
2025-04-22 8:03 ` Andy Shevchenko
2025-04-27 7:55 ` Thomas Bogendoerfer
0 siblings, 2 replies; 7+ messages in thread
From: Thorsten Blum @ 2025-04-22 7:42 UTC (permalink / raw)
To: Thomas Bogendoerfer, Alexander Sverdlin, Andy Shevchenko,
Linus Walleij, Bartosz Golaszewski
Cc: Thorsten Blum, linux-hardening, linux-mips, linux-kernel
strcpy() is deprecated; use strscpy() instead.
Link: https://github.com/KSPP/linux/issues/88
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
arch/mips/bcm63xx/boards/board_bcm963xx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/bcm63xx/boards/board_bcm963xx.c b/arch/mips/bcm63xx/boards/board_bcm963xx.c
index 9cc8fbf218a5..c5617b889b1c 100644
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
@@ -764,7 +764,7 @@ void __init board_prom_init(void)
snprintf(cfe_version, 12, "%s", (char *) &cfe[4]);
}
} else {
- strcpy(cfe_version, "unknown");
+ strscpy(cfe_version, "unknown");
}
pr_info("CFE version: %s\n", cfe_version);
--
2.49.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH] MIPS: BCM63XX: Replace strcpy() with strscpy() in board_prom_init()
2025-04-22 7:42 [PATCH] MIPS: BCM63XX: Replace strcpy() with strscpy() in board_prom_init() Thorsten Blum
@ 2025-04-22 8:03 ` Andy Shevchenko
2025-04-22 8:27 ` Thorsten Blum
2025-04-27 7:55 ` Thomas Bogendoerfer
1 sibling, 1 reply; 7+ messages in thread
From: Andy Shevchenko @ 2025-04-22 8:03 UTC (permalink / raw)
To: Thorsten Blum
Cc: Thomas Bogendoerfer, Alexander Sverdlin, Linus Walleij,
Bartosz Golaszewski, linux-hardening, linux-mips, linux-kernel
On Tue, Apr 22, 2025 at 09:42:55AM +0200, Thorsten Blum wrote:
> strcpy() is deprecated; use strscpy() instead.
> Link: https://github.com/KSPP/linux/issues/88
> Cc: linux-hardening@vger.kernel.org
Can you use --cc OR put this line...
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
...here (after the cutter), so we won't see this in the commit message? The
list will be available in the lore archive anyway.
> @@ -764,7 +764,7 @@ void __init board_prom_init(void)
> snprintf(cfe_version, 12, "%s", (char *) &cfe[4]);
> }
> } else {
> - strcpy(cfe_version, "unknown");
> + strscpy(cfe_version, "unknown");
> }
Have you compiled this with `make W=1` with recent GCCs? I would recommend to
rewrite the whole function, as per commit ee44a1def7ee ("leds: core: Bail out
when composed name can't fit the buffer") in Linux Next.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] MIPS: BCM63XX: Replace strcpy() with strscpy() in board_prom_init()
2025-04-22 8:03 ` Andy Shevchenko
@ 2025-04-22 8:27 ` Thorsten Blum
2025-04-22 10:17 ` Andy Shevchenko
0 siblings, 1 reply; 7+ messages in thread
From: Thorsten Blum @ 2025-04-22 8:27 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Thomas Bogendoerfer, Alexander Sverdlin, Linus Walleij,
Bartosz Golaszewski, linux-hardening, linux-mips, linux-kernel
Hi Andy,
On 22. Apr 2025, at 10:03, Andy Shevchenko wrote:
> Can you use --cc OR put this line...
Yes, will do next time.
> Have you compiled this with `make W=1` with recent GCCs?
Yes, I compile-tested it with W=1 and mips64-linux-gnu-gcc 14.2.1.
Thanks,
Thorsten
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] MIPS: BCM63XX: Replace strcpy() with strscpy() in board_prom_init()
2025-04-22 8:27 ` Thorsten Blum
@ 2025-04-22 10:17 ` Andy Shevchenko
2025-04-22 10:33 ` Thorsten Blum
0 siblings, 1 reply; 7+ messages in thread
From: Andy Shevchenko @ 2025-04-22 10:17 UTC (permalink / raw)
To: Thorsten Blum
Cc: Thomas Bogendoerfer, Alexander Sverdlin, Linus Walleij,
Bartosz Golaszewski, linux-hardening, linux-mips, linux-kernel
On Tue, Apr 22, 2025 at 10:27:33AM +0200, Thorsten Blum wrote:
> On 22. Apr 2025, at 10:03, Andy Shevchenko wrote:
> > Can you use --cc OR put this line...
>
> Yes, will do next time.
>
> > Have you compiled this with `make W=1` with recent GCCs?
>
> Yes, I compile-tested it with W=1 and mips64-linux-gnu-gcc 14.2.1.
Cool, no warnings?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] MIPS: BCM63XX: Replace strcpy() with strscpy() in board_prom_init()
2025-04-22 10:17 ` Andy Shevchenko
@ 2025-04-22 10:33 ` Thorsten Blum
2025-04-22 15:18 ` Andy Shevchenko
0 siblings, 1 reply; 7+ messages in thread
From: Thorsten Blum @ 2025-04-22 10:33 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Thomas Bogendoerfer, Alexander Sverdlin, Linus Walleij,
Bartosz Golaszewski, linux-hardening, linux-mips, linux-kernel
On 22. Apr 2025, at 12:17, Andy Shevchenko wrote:
> On Tue, Apr 22, 2025 at 10:27:33AM +0200, Thorsten Blum wrote:
>> On 22. Apr 2025, at 10:03, Andy Shevchenko wrote:
>>> Can you use --cc OR put this line...
>>
>> Yes, will do next time.
>>
>>> Have you compiled this with `make W=1` with recent GCCs?
>>
>> Yes, I compile-tested it with W=1 and mips64-linux-gnu-gcc 14.2.1.
>
> Cool, no warnings?
No warnings, at least none related to my change or compiling
board_bcm963xx.c
Best,
Thorsten
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] MIPS: BCM63XX: Replace strcpy() with strscpy() in board_prom_init()
2025-04-22 10:33 ` Thorsten Blum
@ 2025-04-22 15:18 ` Andy Shevchenko
0 siblings, 0 replies; 7+ messages in thread
From: Andy Shevchenko @ 2025-04-22 15:18 UTC (permalink / raw)
To: Thorsten Blum
Cc: Thomas Bogendoerfer, Alexander Sverdlin, Linus Walleij,
Bartosz Golaszewski, linux-hardening, linux-mips, linux-kernel
On Tue, Apr 22, 2025 at 12:33:48PM +0200, Thorsten Blum wrote:
> On 22. Apr 2025, at 12:17, Andy Shevchenko wrote:
> > On Tue, Apr 22, 2025 at 10:27:33AM +0200, Thorsten Blum wrote:
> >> On 22. Apr 2025, at 10:03, Andy Shevchenko wrote:
> >>> Can you use --cc OR put this line...
> >>
> >> Yes, will do next time.
> >>
> >>> Have you compiled this with `make W=1` with recent GCCs?
> >>
> >> Yes, I compile-tested it with W=1 and mips64-linux-gnu-gcc 14.2.1.
> >
> > Cool, no warnings?
>
> No warnings, at least none related to my change or compiling
> board_bcm963xx.c
Thanks for confirming!
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] MIPS: BCM63XX: Replace strcpy() with strscpy() in board_prom_init()
2025-04-22 7:42 [PATCH] MIPS: BCM63XX: Replace strcpy() with strscpy() in board_prom_init() Thorsten Blum
2025-04-22 8:03 ` Andy Shevchenko
@ 2025-04-27 7:55 ` Thomas Bogendoerfer
1 sibling, 0 replies; 7+ messages in thread
From: Thomas Bogendoerfer @ 2025-04-27 7:55 UTC (permalink / raw)
To: Thorsten Blum
Cc: Alexander Sverdlin, Andy Shevchenko, Linus Walleij,
Bartosz Golaszewski, linux-hardening, linux-mips, linux-kernel
On Tue, Apr 22, 2025 at 09:42:55AM +0200, Thorsten Blum wrote:
> strcpy() is deprecated; use strscpy() instead.
>
> Link: https://github.com/KSPP/linux/issues/88
> Cc: linux-hardening@vger.kernel.org
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
> arch/mips/bcm63xx/boards/board_bcm963xx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/mips/bcm63xx/boards/board_bcm963xx.c b/arch/mips/bcm63xx/boards/board_bcm963xx.c
> index 9cc8fbf218a5..c5617b889b1c 100644
> --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
> +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
> @@ -764,7 +764,7 @@ void __init board_prom_init(void)
> snprintf(cfe_version, 12, "%s", (char *) &cfe[4]);
> }
> } else {
> - strcpy(cfe_version, "unknown");
> + strscpy(cfe_version, "unknown");
> }
> pr_info("CFE version: %s\n", cfe_version);
>
> --
> 2.49.0
applied to mips-next.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-04-27 8:48 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-22 7:42 [PATCH] MIPS: BCM63XX: Replace strcpy() with strscpy() in board_prom_init() Thorsten Blum
2025-04-22 8:03 ` Andy Shevchenko
2025-04-22 8:27 ` Thorsten Blum
2025-04-22 10:17 ` Andy Shevchenko
2025-04-22 10:33 ` Thorsten Blum
2025-04-22 15:18 ` Andy Shevchenko
2025-04-27 7:55 ` Thomas Bogendoerfer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox