lkml.org 
[lkml]   [2023]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] powerpc/ps3: refactor strncpy usage
Date
Justin Stitt <justinstitt@google.com> writes:
> `strncpy` is deprecated for use on NUL-terminated destination strings [1].
>
> `make_first_field()` should use similar implementation to `make_field()`
> due to memcpy having more obvious behavior here. The end result yields
> the same behavior as the previous `strncpy`-based implementation
> including the NUL-padding.
>
> Link: 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
> Signed-off-by: Justin Stitt <justinstitt@google.com>
> ---
> Note:
> This follows up on a previous RFC which can be found here:
> https://lore.kernel.org/all/20230811-strncpy-arch-powerpc-platforms-ps3-v1-0-301052a5663e@google.com/
> ---
> arch/powerpc/platforms/ps3/repository.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

This looks good to me. I'll pick this up directly, Geoff let me know if
this breaks something somehow.

cheers

\
 
 \ /
  Last update: 2023-08-17 08:36    [W:0.055 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site