[PATCH] nvme-fabrics: replace deprecated strncpy with strscpy
Kees Cook
keescook at chromium.org
Thu Nov 30 14:00:54 PST 2023
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
More information about the Linux-nvme
mailing list