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]
Date: Thu, 28 Mar 2024 15:00:19 -0700
From: Kees Cook <keescook@...omium.org>
To: Tony Luck <tony.luck@...el.com>,
	"Guilherme G. Piccoli" <gpiccoli@...lia.com>,
	Justin Stitt <justinstitt@...gle.com>
Cc: Kees Cook <keescook@...omium.org>,
	linux-hardening@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] pstore/blk: replace deprecated strncpy with strscpy

On Thu, 28 Mar 2024 20:54:16 +0000, 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 know that info-device should be NUL-terminated based on its use with
> strlen():
> |	static int __init mtdpstore_init(void)
> |	{
> |		int ret;
> |		struct mtdpstore_context *cxt = &oops_cxt;
> |		struct pstore_blk_config *info = &cxt->info;
> |
> |		ret = pstore_blk_get_config(info);
> |		if (unlikely(ret))
> |			return ret;
> |
> |		if (strlen(info->device) == 0) {
> |			pr_err("mtd device must be supplied (device name is empty)\n");
> ...
> 
> [...]

Applied to for-next/pstore, thanks!

[1/1] pstore/blk: replace deprecated strncpy with strscpy
      https://git.kernel.org/kees/c/80b735d01bbb

Take care,

-- 
Kees Cook


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ