linux-hardening.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/8] sparc: PCI: Replace deprecated strcpy with strscpy
@ 2025-09-22 21:03 Thorsten Blum
  2025-09-22 21:03 ` [PATCH 2/8] sparc: parport: Replace deprecated strcpy with strscpy in ecpp_probe Thorsten Blum
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Thorsten Blum @ 2025-09-22 21:03 UTC (permalink / raw)
  To: David S. Miller, Andreas Larsson, Bjorn Helgaas,
	Ilpo Järvinen
  Cc: linux-hardening, Thorsten Blum, sparclinux, linux-kernel

strcpy() is deprecated; use strscpy() instead.

No functional changes intended.

Link: https://github.com/KSPP/linux/issues/88
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 arch/sparc/kernel/pcic.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c
index 25fe0a061732..f894ae79e78a 100644
--- a/arch/sparc/kernel/pcic.c
+++ b/arch/sparc/kernel/pcic.c
@@ -16,6 +16,7 @@
 #include <linux/init.h>
 #include <linux/mm.h>
 #include <linux/slab.h>
+#include <linux/string.h>
 #include <linux/jiffies.h>
 
 #include <asm/swift.h> /* for cache flushing. */
@@ -352,7 +353,7 @@ int __init pcic_probe(void)
 	pbm = &pcic->pbm;
 	pbm->prom_node = node;
 	prom_getstring(node, "name", namebuf, 63);  namebuf[63] = 0;
-	strcpy(pbm->prom_name, namebuf);
+	strscpy(pbm->prom_name, namebuf);
 
 	{
 		extern int pcic_nmi_trap_patch[4];
@@ -477,7 +478,7 @@ static void pcic_map_pci_device(struct linux_pcic *pcic,
 	int j;
 
 	if (node == 0 || node == -1) {
-		strcpy(namebuf, "???");
+		strscpy(namebuf, "???");
 	} else {
 		prom_getstring(node, "name", namebuf, 63); namebuf[63] = 0;
 	}
@@ -536,7 +537,7 @@ pcic_fill_irq(struct linux_pcic *pcic, struct pci_dev *dev, int node)
 	char namebuf[64];
 
 	if (node == 0 || node == -1) {
-		strcpy(namebuf, "???");
+		strscpy(namebuf, "???");
 	} else {
 		prom_getstring(node, "name", namebuf, sizeof(namebuf));
 	}
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-10-18 17:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-22 21:03 [PATCH 1/8] sparc: PCI: Replace deprecated strcpy with strscpy Thorsten Blum
2025-09-22 21:03 ` [PATCH 2/8] sparc: parport: Replace deprecated strcpy with strscpy in ecpp_probe Thorsten Blum
2025-09-22 21:03 ` [PATCH 3/8] sparc: floppy: Replace deprecated strcpy with strscpy in sun_floppy_init Thorsten Blum
2025-10-13 20:57   ` Andy Shevchenko
2025-09-22 21:03 ` [PATCH 4/8] sparc: Replace deprecated strcpy with strscpy in prom_nextprop Thorsten Blum
2025-09-22 21:03 ` [PATCH 5/8] sparc: Replace deprecated strcpy with strscpy Thorsten Blum
2025-09-22 21:03 ` [PATCH 6/8] sparc32: " Thorsten Blum
2025-09-22 21:03 ` [PATCH 7/8] sparc64: Replace deprecated strcpy with strscpy in build_path_component Thorsten Blum
2025-09-22 21:03 ` [PATCH 8/8] sparc: Replace deprecated strcpy with strscpy in handle_nextprop_quirks Thorsten Blum
2025-09-26 14:44 ` [PATCH 1/8] sparc: PCI: Replace deprecated strcpy with strscpy Andreas Larsson
2025-09-26 15:32   ` Andreas Larsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).