]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
riscv: Sanitize syscall table indexing under speculation
authorLukas Gerlach <lukas.gerlach@cispa.de>
Thu, 18 Dec 2025 19:13:32 +0000 (20:13 +0100)
committerPaul Walmsley <pjw@kernel.org>
Wed, 31 Dec 2025 02:57:55 +0000 (19:57 -0700)
commit25fd7ee7bf58ac3ec7be3c9f82ceff153451946c
treea2cbd65e3fbd522159d9d6bdb413d7f171b8c9ca
parent66562b66dcbc8f93c1e28632299f449bb2f5c47d
riscv: Sanitize syscall table indexing under speculation

The syscall number is a user-controlled value used to index into the
syscall table. Use array_index_nospec() to clamp this value after the
bounds check to prevent speculative out-of-bounds access and subsequent
data leakage via cache side channels.

Signed-off-by: Lukas Gerlach <lukas.gerlach@cispa.de>
Link: https://patch.msgid.link/20251218191332.35849-3-lukas.gerlach@cispa.de
Signed-off-by: Paul Walmsley <pjw@kernel.org>
arch/riscv/kernel/traps.c