[PW_SID:1127847] KVM: riscv: Fix Spectre-v1 in vector register access#2287
[PW_SID:1127847] KVM: riscv: Fix Spectre-v1 in vector register access#2287linux-riscv-bot wants to merge 3 commits into
Conversation
setup_smp() calls set_cpu_possible() for CPUs 1..nr_cpu_ids-1 but never for CPU 0 (the boot CPU). x86 handles this via init_cpu_possible(cpumask_of(0)); RISC-V has no equivalent. Without CPU 0 in cpu_possible_mask, rcu_init_one()'s for_each_possible_cpu() loop skips it, leaving rdp->mynode=NULL. rcutree_prepare_cpu() then dereferences NULL and hangs. Exposed on Sophgo SG2042 (64-hart, 4-NUMA) with Linux 7.2-rc3. Cc: stable@vger.kernel.org Fixes: a4166ae ("riscv: Deduplicate code in setup_smp()") Signed-off-by: Paul Sherman <shermanpauldylan@gmail.com> Link: https://patch.msgid.link/20260714223301.5265-1-shermanpauldylan@gmail.com Signed-off-by: Paul Walmsley <pjw@kernel.org>
User-controlled register indices from the ONE_REG ioctl are used to index into the vector register buffer (v0..v31). Sanitize the calculated offset with array_index_nospec() to prevent speculative out-of-bounds access. Signed-off-by: Zongmin Zhou <zhouzongmin@kylinos.cn> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "KVM: riscv: Fix Spectre-v1 in vector register access" |
|
Patch 1: "KVM: riscv: Fix Spectre-v1 in vector register access" |
|
Patch 1: "KVM: riscv: Fix Spectre-v1 in vector register access" |
|
Patch 1: "KVM: riscv: Fix Spectre-v1 in vector register access" |
|
Patch 1: "KVM: riscv: Fix Spectre-v1 in vector register access" |
|
Patch 1: "KVM: riscv: Fix Spectre-v1 in vector register access" |
|
Patch 1: "KVM: riscv: Fix Spectre-v1 in vector register access" |
|
Patch 1: "KVM: riscv: Fix Spectre-v1 in vector register access" |
|
Patch 1: "KVM: riscv: Fix Spectre-v1 in vector register access" |
|
Patch 1: "KVM: riscv: Fix Spectre-v1 in vector register access" |
|
Patch 1: "KVM: riscv: Fix Spectre-v1 in vector register access" |
|
Patch 1: "KVM: riscv: Fix Spectre-v1 in vector register access" |
60e0882 to
36eafdd
Compare
PR for series 1127847 applied to workflow__riscv__fixes
Name: KVM: riscv: Fix Spectre-v1 in vector register access
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1127847
Version: 1