Commit 62c6d82b authored by Nick Terrell's avatar Nick Terrell Committed by Greg Kroah-Hartman
Browse files

zstd: Fix array-index-out-of-bounds UBSAN warning

[ Upstream commit 77618db3 ]

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: default avatar <syzbot+1f2eb3e8cd123ffce499@syzkaller.appspotmail.com>
Reported-by: default avatarEric Biggers <ebiggers@kernel.org>
Reported-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarNick Terrell <terrelln@fb.com>
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 875ee3a0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment