]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: riscv: Fix Spectre-v1 in AIA CSR access
authorLukas Gerlach <lukas.gerlach@cispa.de>
Tue, 3 Mar 2026 14:19:42 +0000 (15:19 +0100)
committerAnup Patel <anup@brainfault.org>
Fri, 6 Mar 2026 05:50:30 +0000 (11:20 +0530)
commitec87a82ca8740891bce9e93e79ea2cd6c2d70ac8
tree1aa86e8a4eb059048a3c591af45630982ff16036
parentf9e26fc325411a34555ad07ddf0a19ff72ea06d4
KVM: riscv: Fix Spectre-v1 in AIA CSR access

User-controlled indices are used to access AIA CSR registers.
Sanitize them with array_index_nospec() to prevent speculative
out-of-bounds access.

Similar to x86 commit 8c86405f606c ("KVM: x86: Protect
ioapic_read_indirect() from Spectre-v1/L1TF attacks") and arm64
commit 41b87599c743 ("KVM: arm/arm64: vgic: fix possible spectre-v1
in vgic_get_irq()").

Reviewed-by: Radim Krčmář <radim.krcmar@oss.qualcomm.com>
Signed-off-by: Lukas Gerlach <lukas.gerlach@cispa.de>
Link: https://lore.kernel.org/r/20260303-kvm-riscv-spectre-v1-v2-2-192caab8e0dc@cispa.de
Signed-off-by: Anup Patel <anup@brainfault.org>
arch/riscv/kvm/aia.c