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: <202502131235.D4C0CD2@keescook>
Date: Thu, 13 Feb 2025 12:36:09 -0800
From: Kees Cook <kees@...nel.org>
To: Bart Van Assche <bvanassche@....org>
Cc: Thorsten Blum <thorsten.blum@...ux.dev>,
	Don Brace <don.brace@...rochip.com>,
	"James E.J. Bottomley" <James.Bottomley@...senpartnership.com>,
	"Martin K. Petersen" <martin.petersen@...cle.com>,
	linux-hardening@...r.kernel.org, storagedev@...rochip.com,
	linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] scsi: hpsa: Replace deprecated strncpy() with
 strscpy()

On Thu, Feb 13, 2025 at 12:34:55PM -0800, Bart Van Assche wrote:
> Something I should have noticed earlier: this code occurs inside sysfs
> write callbacks. The strings passed to sysfs write callbacks are
> 0-terminated. Hence, 'buf' can be passed directly to sscanf() and
> tmpbuf[] can be removed. From kernfs_fop_write_iter() in fs/kernfs.c:
> 
> 	buf[len] = '\0';	/* guarantee string termination */

Oh, good point! Yeah, ignore my last email. Yes: tmpbuf can be dropped
entirely. :)

-- 
Kees Cook

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ