Main-line Linux kernel tree http://www.kernel.org
Go to file
Azeem Shaikh acf15e07eb netfilter: ipset: 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].
In an effort to remove strlcpy() completely [2], replace
strlcpy() here with strscpy().

Direct replacement is safe here since return value from all
callers of STRLCPY macro were ignored.

[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>
Acked-by: Jozsef Kadlecsik <kadlec@netfilter.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20230613003437.3538694-1-azeemshaikh38@gmail.com
2023-06-20 13:35:37 -07:00
arch uml: Replace strlcpy with strscpy 2023-06-20 13:35:37 -07:00
block
certs
crypto
Documentation
drivers
fs jbd2: Avoid printing outside the boundary of the buffer 2023-06-05 15:31:12 -07:00
include lib/string_helpers: Change returned value of the strreplace() 2023-06-05 15:31:12 -07:00
init
io_uring
ipc
kernel kallsyms: Replace all non-returning strlcpy with strscpy 2023-06-14 12:27:38 -07:00
lib kobject: Use return value of strreplace() 2023-06-05 15:31:12 -07:00
LICENSES
mm
net netfilter: ipset: Replace strlcpy with strscpy 2023-06-20 13:35:37 -07:00
rust
samples
scripts checkpatch: Check for 0-length and 1-element arrays 2023-06-05 15:31:12 -07:00
security
sound
tools
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.