linux/lib/zstd/common
Nick Terrell 62c6d82bac zstd: Fix array-index-out-of-bounds UBSAN warning
[ Upstream commit 77618db346 ]

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>
History 2023-12-13 18:39:04 +01:00
..
bitstream.h lib: zstd: Upgrade to latest upstream zstd version 1.4.10 2021-11-08 16:55:32 -08:00
compiler.h lib: zstd: Don't inline functions in zstd_opt.c 2021-11-18 13:15:33 -08:00
cpu.h lib: zstd: Upgrade to latest upstream zstd version 1.4.10 2021-11-08 16:55:32 -08:00
debug.c lib: zstd: Upgrade to latest upstream zstd version 1.4.10 2021-11-08 16:55:32 -08:00
debug.h lib: zstd: Upgrade to latest upstream zstd version 1.4.10 2021-11-08 16:55:32 -08:00
entropy_common.c zstd: Fixing mixed module-builtin objects 2022-10-03 03:52:58 +09:00
error_private.c lib: zstd: Upgrade to latest upstream zstd version 1.4.10 2021-11-08 16:55:32 -08:00
error_private.h lib: zstd: Upgrade to latest upstream zstd version 1.4.10 2021-11-08 16:55:32 -08:00
fse.h lib: zstd: Upgrade to latest upstream zstd version 1.4.10 2021-11-08 16:55:32 -08:00
fse_decompress.c zstd: Fix array-index-out-of-bounds UBSAN warning 2023-12-13 18:39:04 +01:00
huf.h lib: zstd: Upgrade to latest upstream zstd version 1.4.10 2021-11-08 16:55:32 -08:00
mem.h lib: zstd: Upgrade to latest upstream zstd version 1.4.10 2021-11-08 16:55:32 -08:00
zstd_common.c zstd: Fixing mixed module-builtin objects 2022-10-03 03:52:58 +09:00
zstd_deps.h zstd: Fix definition of assert() 2023-04-06 12:10:38 +02:00
zstd_internal.h lib: zstd: Upgrade to latest upstream zstd version 1.4.10 2021-11-08 16:55:32 -08:00