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

From: Nam Cao

Date: Fri Jun 12 2026 - 17:51:45 EST


Mark Harris <mark.hsj@xxxxxxxxx> 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@xxxxxxxxx>

Reviewed-by: Nam Cao <namcao@xxxxxxxxxxxxx>