cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] kernfs: Convert from strlcpy() to strscpy()
@ 2023-12-12 21:17 Kees Cook
  2023-12-12 21:17 ` [PATCH v3 1/3] kernfs: Convert kernfs_walk_ns() " Kees Cook
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Kees Cook @ 2023-12-12 21:17 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Kees Cook, Tejun Heo, Azeem Shaikh, Zefan Li, Johannes Weiner,
	Waiman Long, Christophe JAILLET, linux-kernel, cgroups, bpf,
	linux-hardening

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/20231130200937.it.424-kees@kernel.org/
v1: https://lore.kernel.org/linux-hardening/20231116191718.work.246-kees@kernel.org/

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(-)

-- 
2.34.1


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

end of thread, other threads:[~2023-12-22  1:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-12 21:17 [PATCH v3 0/3] kernfs: Convert from strlcpy() to strscpy() Kees Cook
2023-12-12 21:17 ` [PATCH v3 1/3] kernfs: Convert kernfs_walk_ns() " Kees Cook
2023-12-22  0:58   ` Tejun Heo
2023-12-12 21:17 ` [PATCH v3 2/3] kernfs: Convert kernfs_name_locked() " Kees Cook
2023-12-22  0:59   ` Tejun Heo
2023-12-12 21:17 ` [PATCH v3 3/3] kernfs: Convert kernfs_path_from_node_locked() " Kees Cook
2023-12-22  1:18   ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).