Skip to content

string.h: Use ARRAY_SIZE() for memtostr*()/strtomem*()

Kees Cook linux-hardening lkml llvm 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 2 repliesIn review
  2. v13 patches 14 repliesSuperseded

Changes in v2 from the cover letter

- 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/[email protected]/

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3compiler.h: Move C string helpers into C-only kernel sectioninclude/linux/compiler.h+13 -130 replies
2/3compiler.h: Introduce __must_be_byte_array()include/linux/compiler.h+7 -10 replies
3/3string.h: Use ARRAY_SIZE() for memtostr*()/strtomem*()include/linux/string.h+8 -42 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchMiguel OjedaSuren Baghdasaryan
1/3R-b
2/3
3/3T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] string.h: Use ARRAY_SIZE() for memtostr*()/strtomem*()

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/[email protected]/

-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(-)
Signature · 1 line
2.34.1