[PATCH] riscv: hwprobe: Avoid uninitialized read in hwprobe_get_cpus()

Nam Cao namcao at linutronix.de
Fri Jun 12 14:50:13 PDT 2026


Mark Harris <mark.hsj at gmail.com> writes:
> When cpusetsize < cpumask_size(), hwprobe_get_cpus() did not fully
> initialize its copy of the cpu mask, which could cause non-deterministic
> results from the riscv_hwprobe syscall on a system with more than 8 CPUs
> when the supplied cpu mask is empty.  Address this by fully initializing
> the cpu mask.
>
> Signed-off-by: Mark Harris <mark.hsj at gmail.com>

Reviewed-by: Nam Cao <namcao at linutronix.de>



More information about the linux-riscv mailing list