public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] string.h: Use ARRAY_SIZE() for memtostr*()/strtomem*()
@ 2025-02-06 21:40 Kees Cook
  2025-02-06 21:40 ` [PATCH v2 1/3] compiler.h: Move C string helpers into C-only kernel section Kees Cook
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Kees Cook @ 2025-02-06 21:40 UTC (permalink / raw)
  To: Suren Baghdasaryan
  Cc: Kees Cook, Miguel Ojeda, Kent Overstreet, kernel test robot,
	Andy Shevchenko, Luc Van Oostenryck, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Philipp Reisner,
	linux-kernel, linux-hardening, llvm

Work around a Clang <15 bug by switching to ARRAY_SIZE() (with the
added benefit of explicitly checking for char array arguments) in
memtostr*/strtomem*().

 v2:
  - change __must_be_byte_array to __must_be_byte_array() (david)
  - add missed Suggested-by (kent)
  - clarify move log (miguel)
  - clarify cover letter Clang version (andy)
 v1: https://lore.kernel.org/lkml/20250206175216.work.225-kees@kernel.org/

-Kees

Kees Cook (3):
  compiler.h: Move C string helpers into C-only kernel section
  compiler.h: Introduce __must_be_byte_array()
  string.h: Use ARRAY_SIZE() for memtostr*()/strtomem*()

 include/linux/compiler.h | 32 +++++++++++++++++++-------------
 include/linux/string.h   | 12 ++++++++----
 2 files changed, 27 insertions(+), 17 deletions(-)

-- 
2.34.1


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

end of thread, other threads:[~2025-02-07  1:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-06 21:40 [PATCH v2 0/3] string.h: Use ARRAY_SIZE() for memtostr*()/strtomem*() Kees Cook
2025-02-06 21:40 ` [PATCH v2 1/3] compiler.h: Move C string helpers into C-only kernel section Kees Cook
2025-02-06 21:40 ` [PATCH v2 2/3] compiler.h: Introduce __must_be_byte_array() Kees Cook
2025-02-06 21:40 ` [PATCH v2 3/3] string.h: Use ARRAY_SIZE() for memtostr*()/strtomem*() Kees Cook
2025-02-06 23:59   ` Suren Baghdasaryan
2025-02-07  1:01     ` Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox