Re: [PATCH] scsi: target: Replace deprecated strncpy() with strscpy()

2025-03-02 Thread Kees Cook
On Wed, Feb 26, 2025 at 01:10:03PM +0100, Thorsten Blum wrote: > Since strncpy() is deprecated for NUL-terminated destination buffers, > use strscpy() instead. > > Compile-tested only. > > Link: https://github.com/KSPP/linux/issues/90 > Cc: linux-hardening@vger.kernel.org > Signed-off-by: Thorste

Re: [PATCH] scsi: target: Replace deprecated strncpy() with strscpy()

2025-03-02 Thread Thorsten Blum
On 28. Feb 2025, at 21:10, Kees Cook wrote: > On Wed, Feb 26, 2025 at 01:10:03PM +0100, Thorsten Blum wrote: >> Since strncpy() is deprecated for NUL-terminated destination buffers, >> use strscpy() instead. >> >> Compile-tested only. >> >> Link: https://github.com/KSPP/linux/issues/90 >> Cc: lin

[PATCH] scsi: target: Replace deprecated strncpy() with strscpy()

2025-02-26 Thread Thorsten Blum
Since strncpy() is deprecated for NUL-terminated destination buffers, use strscpy() instead. Compile-tested only. Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Thorsten Blum --- drivers/target/target_core_configfs.c | 2 +- 1 file changed, 1 in

Re: [PATCH] scsi: target: replace deprecated strncpy with strscpy

2024-03-18 Thread Kees Cook
On Mon, Mar 18, 2024 at 09:32:01PM +, Justin Stitt wrote: > strncpy() is deprecated for use on NUL-terminated destination strings > [1] and as such we should prefer more robust and less ambiguous string > interfaces. > > We expect db_root and db_root_stage to be NUL-terminated based on its > i

[PATCH] scsi: target: replace deprecated strncpy with strscpy

2024-03-18 Thread Justin Stitt
strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect db_root and db_root_stage to be NUL-terminated based on its immediate use with pr_debug which expects a C-string argument (%s). Moreove