lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250917155038.GA1852582@bhelgaas>
Date: Wed, 17 Sep 2025 10:50:38 -0500
From: Bjorn Helgaas <helgaas@...nel.org>
To: Thorsten Blum <thorsten.blum@...ux.dev>
Cc: "David S. Miller" <davem@...emloft.net>,
	Andreas Larsson <andreas@...sler.com>,
	Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
	Bjorn Helgaas <bhelgaas@...gle.com>,
	linux-hardening@...r.kernel.org, sparclinux@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH RESEND] sparc: PCI: Replace deprecated strcpy() with
 strscpy()

On Wed, Sep 17, 2025 at 04:47:30PM +0200, Thorsten Blum wrote:
> 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@...ux.dev>

No objection from me, but no particular PCI core issue and I don't
maintain this file, so up to the sparc folks if they want it.

I would consider making a single patch to address this issue
everywhere in arch/sparc so it can all be reviewed together.

> ---
>  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
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ