Re: [PATCH v3 1/3] kernfs: Convert kernfs_walk_ns() from strlcpy() to strscpy()

2023-12-21 Thread Tejun Heo
On Tue, Dec 12, 2023 at 01:17:38PM -0800, Kees Cook wrote: > strlcpy() reads the entire source buffer first. This read may exceed > the destination size limit. This is both inefficient and can lead > to linear read overflows if a source string is not NUL-terminated[1]. > Additionally, it returns th

[PATCH v3 1/3] kernfs: Convert kernfs_walk_ns() from strlcpy() to strscpy()

2023-12-12 Thread Kees Cook
strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated[1]. Additionally, it returns the size of the source string, not the resulting size of the destinat