linux-stable/kernel/bpf/preload
Azeem Shaikh ffadc37252 bpf: Replace all non-returning 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]. This is not
the case here, however, in an effort to remove strlcpy() completely [2],
lets replace strlcpy() here with strscpy(). No return values were used,
so a direct replacement is safe.

  [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy
  [2] https://github.com/KSPP/linux/issues/89

Signed-off-by: Azeem Shaikh <azeemshaikh38@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/bpf/20230530155659.309657-1-azeemshaikh38@gmail.com
2023-05-31 13:04:20 +02:00
..
iterators bpf: iterators: Split iterators.lskel.h into little- and big- endian versions 2023-01-28 12:45:15 -08:00
.gitignore bpf/preload: Clean up .gitignore and "clean-files" target 2021-10-20 10:39:04 -07:00
Kconfig bpf: Convert bpf_preload.ko to use light skeleton. 2022-02-10 23:31:51 +01:00
Makefile bpf: Remove redundant slash 2022-03-07 22:19:32 -08:00
bpf_preload.h bpf: Convert bpf_preload.ko to use light skeleton. 2022-02-10 23:31:51 +01:00
bpf_preload_kern.c bpf: Replace all non-returning strlcpy with strscpy 2023-05-31 13:04:20 +02:00