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] [thread-next>] [day] [month] [year] [list]
Message-ID: <aLbbQ1vwnXYwU6JJ@alpha.franken.de>
Date: Tue, 2 Sep 2025 13:55:47 +0200
From: Thomas Bogendoerfer <tsbogend@...ha.franken.de>
To: Osama Abdelkader <osama.abdelkader@...il.com>
Cc: linux-mips@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mips: math-emu: replace deprecated strcpy() in me-debugfs

On Mon, Sep 01, 2025 at 03:39:19PM +0200, Osama Abdelkader wrote:
> use strscpy() instead of deprecated strcpy().
> 
> Signed-off-by: Osama Abdelkader <osama.abdelkader@...il.com>
> ---
>  arch/mips/math-emu/me-debugfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/mips/math-emu/me-debugfs.c b/arch/mips/math-emu/me-debugfs.c
> index d5ad76b2bb67..94667cbe18e7 100644
> --- a/arch/mips/math-emu/me-debugfs.c
> +++ b/arch/mips/math-emu/me-debugfs.c
> @@ -41,7 +41,7 @@ static void adjust_instruction_counter_name(char *out_name, char *in_name)
>  {
>  	int i = 0;
>  
> -	strcpy(out_name, in_name);
> +	strscpy(out_name, in_name, sizeof(out_name));

this is wrong. sizeof(out_name) is the size of the pointer, but not the
size of the storage behind it. To be able to use strscpy() here you
need to pass in the size of the given buffer and use that.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ