lkml.org 
[lkml]   [2023]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86/tdx: refactor deprecated strncpy

* Kees Cook <keescook@chromium.org> wrote:

> On Mon, 11 Sep 2023 18:27:25 +0000, Justin Stitt wrote:
> > `strncpy` is deprecated and we should prefer more robust string apis.
> >
> > In this case, `message.str` is not expected to be NUL-terminated as it
> > is simply a buffer of characters residing in a union which allows for
> > named fields representing 8 bytes each. There is only one caller of
> > `tdx_panic()` and they use a 59-length string for `msg`:
> > | const char *msg = "TD misconfiguration: SEPT_VE_DISABLE attribute must be set.";
> >
> > [...]
>
> This appears to be trivially correct, so I can take it via my tree.
>
> Applied to for-next/hardening, thanks!
>
> [1/1] x86/tdx: refactor deprecated strncpy
> https://git.kernel.org/kees/c/e32c46753312

Please don't apply - Dave had some reservations, plus after the
change the comment would be now out of sync with the code ...

Also, we generally carry such patches in the x86 tree.

Thanks,

Ingo

\
 
 \ /
  Last update: 2023-09-29 23:15    [W:0.065 / U:2.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site