[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <170138165207.3649333.12518532307083460238.b4-ty@chromium.org>
Date: Thu, 30 Nov 2023 14:00:54 -0800
From: Kees Cook <keescook@...omium.org>
To: Keith Busch <kbusch@...nel.org>,
Jens Axboe <axboe@...nel.dk>,
Christoph Hellwig <hch@....de>,
Sagi Grimberg <sagi@...mberg.me>,
Justin Stitt <justinstitt@...gle.com>
Cc: Kees Cook <keescook@...omium.org>,
linux-nvme@...ts.infradead.org,
linux-kernel@...r.kernel.org,
linux-hardening@...r.kernel.org
Subject: Re: [PATCH] nvme-fabrics: replace deprecated strncpy with strscpy
On Wed, 18 Oct 2023 22:48:49 +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 expect both data->subsysnqn and data->hostnqn to be NUL-terminated
> based on their usage with format specifier ("%s"):
> fabrics.c:
> 322: dev_err(ctrl->device,
> 323: "%s, subsysnqn \"%s\"\n",
> 324: inv_data, data->subsysnqn);
> ...
> 349: dev_err(ctrl->device,
> 350: "Connect for subsystem %s is not allowed, hostnqn: %s\n",
> 351: data->subsysnqn, data->hostnqn);
>
> [...]
Applied to for-next/hardening, thanks!
[1/1] nvme-fabrics: replace deprecated strncpy with strscpy
https://git.kernel.org/kees/c/5ef935fd5520
Take care,
--
Kees Cook
Powered by blists - more mailing lists