Re: [PATCH v2] x86/tdx: replace deprecated strncpy with strtomem_pad

2024-02-09 Thread Kees Cook
On Wed, Feb 07, 2024 at 04:03:35PM +0200, Andy Shevchenko wrote: > On Wed, Oct 04, 2023 at 09:32:54AM +0200, Ingo Molnar wrote: > > ... > > > > Note: Ingo Molnar has some concerns about the comment being out of sync > > > [1] but I believe the comment still has a place as we can still > > > theor

Re: [PATCH v2] x86/tdx: replace deprecated strncpy with strtomem_pad

2024-02-07 Thread Andy Shevchenko
On Wed, Oct 04, 2023 at 09:32:54AM +0200, Ingo Molnar wrote: ... > > Note: Ingo Molnar has some concerns about the comment being out of sync > > [1] but I believe the comment still has a place as we can still > > theoretically copy 64 bytes into our destination buffer without a > > NUL-byte. The

Re: [PATCH v2] x86/tdx: replace deprecated strncpy with strtomem_pad

2023-10-04 Thread Ingo Molnar
* 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://w

Re: [PATCH v2] x86/tdx: replace deprecated strncpy with strtomem_pad

2023-10-03 Thread Dave Hansen
On 10/3/23 14:54, Justin Stitt wrote: > Note: Ingo Molnar has some concerns about the comment being out of sync > [1] but I believe the comment still has a place as we can still > theoretically copy 64 bytes into our destination buffer without a > NUL-byte. The extra information about the 65th byte

Re: [PATCH v2] x86/tdx: replace deprecated strncpy with strtomem_pad

2023-10-03 Thread Kees Cook
On Tue, Oct 03, 2023 at 09:54:59PM +, 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_

[PATCH v2] x86/tdx: replace deprecated strncpy with strtomem_pad

2023-10-03 Thread Justin Stitt
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/depr