Skip to content

string: Allow 2-argument strscpy()

Kees Cook linux-hardening linux-um lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 6 repliesIn review
  2. v24 patches 8 repliesSuperseded
  3. v11 patch 1 replySuperseded

Changes in v3 from the cover letter

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4string: Redefine strscpy_pad() as a macroinclude/linux/string.h lib/string_helpers.c+31 -361 reply
2/4string: Allow 2-argument strscpy()arch/um/include/shared/user.h include/linux/fortify-string.h include/linux/string.h +1 more+41 -240 replies
3/4string: Allow 2-argument strscpy_pad()include/linux/string.h+18 -113 replies
4/4um: Convert strscpy() usage to 2-argument stylearch/um/drivers/net_kern.c arch/um/drivers/vector_kern.c arch/um/drivers/vector_user.c +4 more+10 -102 replies

Reviews trailers per patch

3 of 4 patches have a Reviewed-by or Acked-by.

PatchJustin Stitt
1/4R-b
2/4R-b
3/4R-b
4/4

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

Read the v3 thread

Cover letter [PATCH v3 0/4] string: Allow 2-argument strscpy()

v3:
- add missed args.h include (andy)
v2: https://lore.kernel.org/all/[email protected]/
v1: https://lore.kernel.org/all/[email protected]/

Hi,

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                   | 76 +++++++++++++++++++++++-
 lib/string.c                             |  4 +-
 lib/string_helpers.c                     | 34 -----------
 11 files changed, 88 insertions(+), 69 deletions(-)
Signature · 1 line
2.34.1