No description
Find a file
Arnd Bergmann 700cf4bead EDAC/thunderx: Fix possible out-of-bounds string access
[ Upstream commit 475c58e1a4 ]

Enabling -Wstringop-overflow globally exposes a warning for a common bug
in the usage of strncat():

  drivers/edac/thunderx_edac.c: In function 'thunderx_ocx_com_threaded_isr':
  drivers/edac/thunderx_edac.c:1136:17: error: 'strncat' specified bound 1024 equals destination size [-Werror=stringop-overflow=]
   1136 |                 strncat(msg, other, OCX_MESSAGE_SIZE);
        |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   ...
   1145 |                                 strncat(msg, other, OCX_MESSAGE_SIZE);
   ...
   1150 |                                 strncat(msg, other, OCX_MESSAGE_SIZE);

   ...

Apparently the author of this driver expected strncat() to behave the
way that strlcat() does, which uses the size of the destination buffer
as its third argument rather than the length of the source buffer. The
result is that there is no check on the size of the allocated buffer.

Change it to strlcat().

  [ bp: Trim compiler output, fixup commit message. ]

Fixes: 41003396f9 ("EDAC, thunderx: Add Cavium ThunderX EDAC driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20231122222007.3199885-1-arnd@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-01-25 14:52:32 -08:00
arch x86/lib: Fix overflow when counting digits 2024-01-25 14:52:32 -08:00
block block: Don't invalidate pagecache for invalid falloc modes 2024-01-15 18:51:07 +01:00
certs
crypto crypto: pcrypt - Fix hungtask for PADATA_RESET 2023-11-28 16:56:18 +00:00
Documentation dt-bindings: nvmem: mxs-ocotp: Document fsl,ocotp 2024-01-05 15:13:34 +01:00
drivers EDAC/thunderx: Fix possible out-of-bounds string access 2024-01-25 14:52:32 -08:00
fs jbd2: fix soft lockup in journal_finish_inode_data_buffers() 2024-01-25 14:52:29 -08:00
include kallsyms: Make module_kallsyms_on_each_symbol generally available 2024-01-15 18:51:26 +01:00
init proc: sysctl: prevent aliased sysctls from getting passed to init 2023-12-03 07:31:24 +01:00
io_uring io_uring/af_unix: disable sending io_uring over sockets 2023-12-13 18:36:46 +01:00
ipc
kernel kprobes: Fix to handle forcibly unoptimized kprobes on freeing_list 2024-01-25 14:52:31 -08:00
lib ida: Fix crash in ida_free when the bitmap is empty 2024-01-25 14:52:30 -08:00
LICENSES
mm mm: fix unmap_mapping_range high bits shift bug 2024-01-15 18:51:23 +01:00
net net: qrtr: ns: Return 0 if server port is not present 2024-01-25 14:52:30 -08:00
samples samples/hw_breakpoint: fix building without module unloading 2023-09-23 11:10:01 +02:00
scripts bpf: Add --skip_encoding_btf_inconsistent_proto, --btf_gen_optimized to pahole flags for v1.25 2024-01-25 14:52:31 -08:00
security keys, dns: Allow key types (eg. DNS) to be reclaimed immediately on expiry 2024-01-05 15:13:30 +01:00
sound Revert "ASoC: atmel: Remove system clock tree configuration for at91sam9g20ek" 2024-01-25 14:52:31 -08:00
tools perf inject: Fix GEN_ELF_TEXT_OFFSET for jit 2024-01-15 18:51:25 +01:00
usr
virt KVM: Grab a reference to KVM for VM and vCPU stats file descriptors 2023-08-03 10:22:40 +02:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS iio: stx104: Move to addac subdirectory 2023-08-26 14:23:27 +02:00
Makefile Linux 5.15.147 2024-01-15 18:51:28 +01:00
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.