Skip to content

kernfs: Convert from strlcpy() to strscpy()

Kees Cook bpf cgroups linux-hardening lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 3 repliesIn review
  2. v23 patches 2 repliesSuperseded
  3. v13 patches 4 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3kernfs: Convert kernfs_walk_ns() from strlcpy() to strscpy()fs/kernfs/dir.c+3 -31 reply
2/3kernfs: Convert kernfs_name_locked() from strlcpy() to strscpy()fs/kernfs/dir.c+5 -51 reply
3/3kernfs: Convert kernfs_path_from_node_locked() from strlcpy() to strscpy()fs/kernfs/dir.c kernel/cgroup/cgroup-v1.c kernel/cgroup/cgroup.c +1 more+21 -211 reply

Reviews trailers per patch

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

PatchTejun Heo
1/3A-b
2/3A-b
3/3

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/3] kernfs: Convert from strlcpy() to strscpy()

Hi,

One of the last users of strlcpy() is kernfs, which has some complex calling hierarchies that needed to be carefully examined. This series refactors the strlcpy() calls into strscpy() calls, and bubbles up all changes in return value checking for callers. Future work in kernfs and sysfs will see the replacement of open-coded string handling with the seq_buf API, but we need to do one thing at a time.

Thanks!

-kees

v3: don't need to account for scnprintf() returning negative (christophe.jaillet)
v2: https://lore.kernel.org/all/[email protected]/
v1: https://lore.kernel.org/linux-hardening/[email protected]/

Kees Cook (3):
kernfs: Convert kernfs_walk_ns() from strlcpy() to strscpy()
kernfs: Convert kernfs_name_locked() from strlcpy() to strscpy()
kernfs: Convert kernfs_path_from_node_locked() from strlcpy() to
strscpy()

 fs/kernfs/dir.c           | 50 +++++++++++++++++++--------------------
 kernel/cgroup/cgroup-v1.c |  2 +-
 kernel/cgroup/cgroup.c    |  4 ++--
 kernel/cgroup/cpuset.c    |  2 +-
 4 files changed, 29 insertions(+), 29 deletions(-)
Signature · 1 line
2.34.1