summaryrefslogtreecommitdiff
path: root/scripts/leaking_addresses.pl
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2023-11-30 23:56:08 +0300
committerKees Cook <keescook@chromium.org>2023-12-01 21:25:35 +0300
commit8a3750ecf8104de55c569ffbe844a85aa9d5deaa (patch)
treed6bdc32646904309305b201e0a81f83c772c25ce /scripts/leaking_addresses.pl
parentb5e3f86a47d34f7b8af899f8cc70520f6daf8b53 (diff)
downloadlinux-8a3750ecf8104de55c569ffbe844a85aa9d5deaa.tar.xz
tracing/uprobe: Replace strlcpy() with strscpy()
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 destination string. In an effort to remove strlcpy() completely[2], replace strlcpy() here with strscpy(). The negative return value is already handled by this code so no new handling is needed here. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [1] Link: https://github.com/KSPP/linux/issues/89 [2] Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: linux-trace-kernel@vger.kernel.org Acked-by: "Masami Hiramatsu (Google)" <mhiramat@kernel.org> Link: https://lore.kernel.org/r/20231130205607.work.463-kees@kernel.org Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'scripts/leaking_addresses.pl')
0 files changed, 0 insertions, 0 deletions