public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] string: Allow 2-argument strscpy()
@ 2024-02-05 12:35 Kees Cook
  2024-02-05 12:35 ` [PATCH v2 1/4] string: Redefine strscpy_pad() as a macro Kees Cook
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Kees Cook @ 2024-02-05 12:35 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Kees Cook, Richard Weinberger, Justin Stitt, Anton Ivanov,
	Johannes Berg, Willem de Bruijn, Jason Wang, kernel test robot,
	Nathan Chancellor, Azeem Shaikh, linux-kernel, linux-hardening,
	linux-um

Hi,

v2:
 - add strscpy_pad() coverage
 - fix up ARCH=um to handle the renaming
 - use __must_be_array() to validate sizeof() usage
v1: https://lore.kernel.org/all/20240131055340.work.279-kees@kernel.org/

Make it possible for strscpy() and strscpy_pad() to use 2 arguments,
making "sizeof(dst)" be the the default 3rd argument for the destination
size. This can make future usage much easier to read. Additionally allows
treewide changes to save a bunch of lines:
 1177 files changed, 2455 insertions(+), 3026 deletions(-)

-Kees

Kees Cook (4):
  string: Redefine strscpy_pad() as a macro
  string: Allow 2-argument strscpy()
  string: Allow 2-argument strscpy_pad()
  um: Convert strscpy() usage to 2-argument style

 arch/um/drivers/net_kern.c               |  2 +-
 arch/um/drivers/vector_kern.c            |  2 +-
 arch/um/drivers/vector_user.c            |  4 +-
 arch/um/include/shared/user.h            |  3 +-
 arch/um/os-Linux/drivers/ethertap_user.c |  2 +-
 arch/um/os-Linux/drivers/tuntap_user.c   |  2 +-
 arch/um/os-Linux/umid.c                  |  6 +-
 include/linux/fortify-string.h           | 22 +------
 include/linux/string.h                   | 75 +++++++++++++++++++++++-
 lib/string.c                             |  4 +-
 lib/string_helpers.c                     | 34 -----------
 11 files changed, 87 insertions(+), 69 deletions(-)

-- 
2.34.1


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

end of thread, other threads:[~2024-02-05 13:36 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-05 12:35 [PATCH v2 0/4] string: Allow 2-argument strscpy() Kees Cook
2024-02-05 12:35 ` [PATCH v2 1/4] string: Redefine strscpy_pad() as a macro Kees Cook
2024-02-05 12:35 ` [PATCH v2 2/4] string: Allow 2-argument strscpy() Kees Cook
2024-02-05 12:47   ` Geert Uytterhoeven
2024-02-05 12:58     ` Andy Shevchenko
2024-02-05 13:01     ` Kees Cook
2024-02-05 13:07       ` Geert Uytterhoeven
2024-02-05 12:35 ` [PATCH v2 3/4] string: Allow 2-argument strscpy_pad() Kees Cook
2024-02-05 12:48   ` Geert Uytterhoeven
2024-02-05 12:57     ` Andy Shevchenko
2024-02-05 12:35 ` [PATCH v2 4/4] um: Convert strscpy() usage to 2-argument style Kees Cook
2024-02-05 12:50   ` Geert Uytterhoeven
2024-02-05 12:57     ` Andy Shevchenko

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