summaryrefslogtreecommitdiff
path: root/virt
diff options
context:
space:
mode:
authorBjörn Töpel <bjorn@rivosinc.com>2024-11-04 20:15:01 +0100
committerAnup Patel <anup@brainfault.org>2024-11-05 13:27:32 +0530
commit332fa4a802b16ccb727199da685294f85f9880cb (patch)
tree8e0fe1c41d7ccd7b8c9e010c44f9016ab7101b9b /virt
parent60821fb4dd7345e5662094accf0a52845306de8c (diff)
downloadlinux-332fa4a802b16ccb727199da685294f85f9880cb.tar.gz
linux-332fa4a802b16ccb727199da685294f85f9880cb.tar.bz2
linux-332fa4a802b16ccb727199da685294f85f9880cb.zip
riscv: kvm: Fix out-of-bounds array access
In kvm_riscv_vcpu_sbi_init() the entry->ext_idx can contain an out-of-bound index. This is used as a special marker for the base extensions, that cannot be disabled. However, when traversing the extensions, that special marker is not checked prior indexing the array. Add an out-of-bounds check to the function. Fixes: 56d8a385b605 ("RISC-V: KVM: Allow some SBI extensions to be disabled by default") Signed-off-by: Björn Töpel <bjorn@rivosinc.com> Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://lore.kernel.org/r/20241104191503.74725-1-bjorn@kernel.org Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'virt')
0 files changed, 0 insertions, 0 deletions