linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC 0/3] powerpc/ps3: refactor strncpy usage
@ 2023-08-11 21:19 Justin Stitt
  2023-08-11 21:19 ` [PATCH RFC 1/3] powerpc/ps3: refactor strncpy usage attempt 1 Justin Stitt
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Justin Stitt @ 2023-08-11 21:19 UTC (permalink / raw)
  To: Geoff Levand, Michael Ellerman, Nicholas Piggin, Christophe Leroy
  Cc: Kees Cook, Nick Desaulniers, linux-kernel, Nathan Chancellor,
	linux-hardening, Justin Stitt, linuxppc-dev

Within this RFC-series I want to get some comments on two ideas that I
have for refactoring the current `strncpy` usage in repository.c.

When looking at `make_first_field` we see a u64 is being used to store
up to 8 bytes from a literal string. This is slightly suspect to me but
it works? In regards to `strncpy` here, it makes the code needlessly
complex imo.

Please see my two ideas to change this and let me know if any other
approaches are more reasonable.

Link: https://github.com/KSPP/linux/issues/90
Signed-off-by: Justin Stitt <justinstitt@google.com>
---
Justin Stitt (3):
      [RFC] powerpc/ps3: refactor strncpy usage attempt 1
      [RFC] powerpc/ps3: refactor strncpy usage attempt 2
      [RFC] powerpc/ps3: refactor strncpy usage attempt 2.5

 arch/powerpc/platforms/ps3/repository.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
---
base-commit: 52a93d39b17dc7eb98b6aa3edb93943248e03b2f
change-id: 20230811-strncpy-arch-powerpc-platforms-ps3-57a1cdb2ad9b

Best regards,
--
Justin Stitt <justinstitt@google.com>


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-08-14 23:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-11 21:19 [PATCH RFC 0/3] powerpc/ps3: refactor strncpy usage Justin Stitt
2023-08-11 21:19 ` [PATCH RFC 1/3] powerpc/ps3: refactor strncpy usage attempt 1 Justin Stitt
2023-08-14 12:28   ` Michael Ellerman
2023-08-11 21:19 ` [PATCH RFC 2/3] powerpc/ps3: refactor strncpy usage attempt 2 Justin Stitt
2023-08-14 23:13   ` Kees Cook
2023-08-11 21:19 ` [PATCH RFC 3/3] powerpc/ps3: refactor strncpy usage attempt 2.5 Justin Stitt
2023-08-11 21:25 ` [PATCH RFC 0/3] powerpc/ps3: refactor strncpy usage Justin Stitt
2023-08-14 12:31   ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).