OpenCloudOS-Kernel/lib/zstd/common
Nick Terrell 90ed718d6a zstd: Fix array-index-out-of-bounds UBSAN warning
[ Upstream commit 77618db346455129424fadbbaec596a09feaf3bb ]

Zstd used an array of length 1 to mean a flexible array for C89
compatibility. Switch to a C99 flexible array to fix the UBSAN warning.

Tested locally by booting the kernel and writing to and reading from a
BtrFS filesystem with zstd compression enabled. I was unable to reproduce
the issue before the fix, however it is a trivial change.

Link: https://lkml.kernel.org/r/20231012213428.1390905-1-nickrterrell@gmail.com
Reported-by: syzbot+1f2eb3e8cd123ffce499@syzkaller.appspotmail.com
Reported-by: Eric Biggers <ebiggers@kernel.org>
Reported-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Nick Terrell <terrelln@fb.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-12-13 18:44:58 +01:00
..
bitstream.h zstd: import usptream v1.5.2 2022-10-24 12:12:32 -07:00
compiler.h zstd: import usptream v1.5.2 2022-10-24 12:12:32 -07:00
cpu.h
debug.c
debug.h
entropy_common.c zstd: import usptream v1.5.2 2022-10-24 12:12:32 -07:00
error_private.c
error_private.h zstd: import usptream v1.5.2 2022-10-24 12:12:32 -07:00
fse.h zstd: import usptream v1.5.2 2022-10-24 12:12:32 -07:00
fse_decompress.c zstd: Fix array-index-out-of-bounds UBSAN warning 2023-12-13 18:44:58 +01:00
huf.h zstd: import usptream v1.5.2 2022-10-24 12:12:32 -07:00
mem.h zstd: import usptream v1.5.2 2022-10-24 12:12:32 -07:00
portability_macros.h zstd: import usptream v1.5.2 2022-10-24 12:12:32 -07:00
zstd_common.c zstd: Move zstd-common module exports to zstd_common_module.c 2022-10-24 12:12:26 -07:00
zstd_deps.h add intptr_t 2023-06-09 17:44:13 -07:00
zstd_internal.h zstd: import usptream v1.5.2 2022-10-24 12:12:32 -07:00