diff options
| author | Björn Töpel <[email protected]> | 2024-11-04 19:15:01 +0000 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2024-11-05 07:57:32 +0000 |
| commit | 332fa4a802b16ccb727199da685294f85f9880cb (patch) | |
| tree | 8e0fe1c41d7ccd7b8c9e010c44f9016ab7101b9b /rust/helpers/helpers.c | |
| parent | RISC-V: KVM: Fix APLIC in_clrip and clripnum write emulation (diff) | |
| download | kernel-332fa4a802b16ccb727199da685294f85f9880cb.tar.gz kernel-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 <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Anup Patel <[email protected]>
Diffstat (limited to 'rust/helpers/helpers.c')
0 files changed, 0 insertions, 0 deletions
