Messages in this thread | | | Date | Tue, 3 Oct 2023 16:44:09 -0700 | From | Kees Cook <> | Subject | Re: [PATCH v2] x86/tdx: replace deprecated strncpy with strtomem_pad |
| |
On Tue, Oct 03, 2023 at 09:54:59PM +0000, Justin Stitt wrote: > strncpy works perfectly here in all cases, however, it is deprecated and > as such we should prefer more robust and less ambiguous string apis. > > Let's use `strtomem_pad` as this matches the functionality of `strncpy` > and is _not_ deprecated. > > Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] > Link: https://github.com/KSPP/linux/issues/90 > Cc: linux-hardening@vger.kernel.org > Cc: Kees Cook <keescook@chromium.org> > Signed-off-by: Justin Stitt <justinstitt@google.com>
Thanks for respinning this! And yeah, I'd agree the comment probably should stay.
Reviewed-by: Kees Cook <keescook@chromium.org>
-- Kees Cook
| |