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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aLbxNfo9Y0QkF1fC@XPS>
Date: Tue, 2 Sep 2025 15:29:25 +0200
From: Osama Abdelkader <osama.abdelkader@...il.com>
To: Thomas Bogendoerfer <tsbogend@...ha.franken.de>
Cc: linux-mips@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mips: math-emu: replace deprecated strcpy() in me-debugfs

On Tue, Sep 02, 2025 at 01:55:47PM +0200, Thomas Bogendoerfer wrote:
> 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.
> 

Thanks Thomas, I just sent v2.

Regards,
Osama

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