diff options
| author | Thorsten Blum <thorsten.blum@linux.dev> | 2026-04-21 14:26:47 +0200 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2026-05-28 21:24:39 -0700 |
| commit | de5d0652d0633daaaa1f8f322721f600e65b1fb1 (patch) | |
| tree | f832b44f74d2a64d643218379b3f1c92df32f6f2 /scripts | |
| parent | b8979a02f9c56d489e27690981d2aa29a3e79542 (diff) | |
| download | lwn-de5d0652d0633daaaa1f8f322721f600e65b1fb1.tar.gz lwn-de5d0652d0633daaaa1f8f322721f600e65b1fb1.zip | |
proc: use strnlen() for name validation in __proc_create
Replace strlen(fn) with strnlen(fn, NAME_MAX + 1) when validating the
final path component in __proc_create().
This preserves the existing name limit while bounding the length scan to
one byte past the maximum name length. Handle empty names separately, and
treat names longer than NAME_MAX as too long.
Link: https://lore.kernel.org/20260421122648.56723-2-thorsten.blum@linux.dev
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Thorsten Blum <thorsten.blum@linux.dev>
Cc: wangzijie <wangzijie1@honor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions
