linux/arch/riscv/kernel
Mark Harris 5caae1deee riscv: hwprobe: Avoid uninitialized read in hwprobe_get_cpus()
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.

Fixes: e178bf146e ("RISC-V: hwprobe: Introduce which-cpus flag")
Signed-off-by: Mark Harris <mark.hsj@gmail.com>
Reviewed-by: Nam Cao <namcao@linutronix.de>
Reviewed-by: Michael Ellerman <mpe@kernel.org>
Link: https://patch.msgid.link/20260714003056.73707-1-mark.hsj@gmail.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>
2026-07-15 11:12:40 -06:00
..
compat_vdso Makefile: remove redundant tool coverage variables 2024-05-14 23:35:48 +09:00
pi riscv: pi: replace strlcat with strscpy in get_early_cmdline 2026-06-06 20:17:52 -06:00
probes riscv: probes: save original sp in rethook trampoline 2026-06-30 18:46:54 -06:00
tests Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
vdso arch/riscv: vdso: remove CFI landing pad from rt_sigreturn 2026-07-14 19:34:38 -06:00
vdso_cfi riscv: vdso_cfi: Add .gitignore for build artifacts 2026-04-04 18:42:44 -06:00
vendor_extensions riscv: hwprobe: Add MIPS vendor extension probing 2025-09-19 10:33:56 -06:00
.gitignore
acpi_numa.c RISC-V: ACPI: Add acpi_get_cpu_uid() for unified ACPI CPU UID retrieval 2026-04-06 16:55:15 +02:00
acpi.c RISC-V updates for v7.1 2026-04-24 10:00:37 -07:00
alternative.c riscv: alternative: Also patch the CFI vDSO 2026-06-07 01:56:28 -06:00
asm-offsets.c riscv: Fix 32-bit call_on_irq_stack() frame pointer ABI 2026-06-25 13:44:27 -06:00
bugs.c riscv: use sysfs_emit in cpu_show_ghostwrite 2026-06-06 20:17:52 -06:00
cacheinfo.c riscv: cacheinfo: Fix node reference leak in populate_cache_leaves 2026-06-06 23:48:15 -06:00
cfi.c cfi: Move BPF CFI types and helpers to generic code 2025-07-31 18:23:53 -07:00
compat_signal.c riscv: Fix register corruption from uninitialized cregs on error 2026-05-01 21:11:31 -06:00
compat_syscall_table.c riscv: convert to generic syscall table 2024-07-10 14:23:38 +02:00
copy-unaligned.h RISC-V: Report vector unaligned access speed hwprobe 2024-10-18 12:38:34 -07:00
copy-unaligned.S riscv: Define __riscv_copy_{,vec_}{words,bytes}_unaligned() using SYM_TYPED_FUNC_START 2026-04-29 20:38:17 -06:00
cpu_ops_sbi.c riscv: cpu_ops_sbi: No need to be bothered to check ret.error 2026-06-06 23:48:14 -06:00
cpu_ops_spinwait.c riscv: prevent pt_regs corruption for secondary idle threads 2024-05-30 09:42:51 -07:00
cpu_ops.c
cpu-hotplug.c riscv: cpu_ops: Change return value type of cpu_is_stopped() to bool 2026-06-06 23:48:14 -06:00
cpu.c RISC-V: Don't print details of CPUs disabled in DT 2025-10-17 22:02:21 -06:00
cpufeature.c riscv: cpufeature: Use pre-defined ISA ext macros to index isa2hwcap 2026-05-07 19:38:38 -06:00
crash_dump.c
crash_save_regs.S
efi-header.S include: pe.h: Fix PE definitions 2025-05-21 16:46:37 +02:00
efi.c
entry.S riscv: mm: Make mark_new_valid_map() stuff depend on 64BIT && MMU 2026-07-13 11:29:52 -06:00
fpu.S RISC-V: Replace RISCV_MISALIGNED with RISCV_SCALAR_MISALIGNED 2024-10-18 12:38:32 -07:00
ftrace.c riscv: fix various typos in comments and code 2026-04-04 18:42:39 -06:00
head.h riscv: Remove support for XIP kernel 2026-04-04 18:42:44 -06:00
head.S riscv: Remove support for XIP kernel 2026-04-04 18:42:44 -06:00
hibernate-asm.S
hibernate.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
image-vars.h riscv: add platform-specific double word shifts for riscv32 2026-05-28 21:24:51 -07:00
irq.c riscv: panic if IRQ handler stacks cannot be allocated 2026-06-07 00:56:22 -06:00
jump_label.c riscv: Move nop definition to insn-def.h 2025-03-20 09:14:42 +00:00
kernel_mode_fpu.c riscv: add support for kernel-mode FPU 2024-05-19 14:36:19 -07:00
kernel_mode_vector.c riscv: vector: Support xtheadvector save/restore 2025-01-18 12:33:33 -08:00
kexec_elf.c riscv: kexec: use min to simplify riscv_kexec_elf_load 2026-06-07 01:06:19 -06:00
kexec_image.c riscv: kexec_image: Fix dead link to boot-image-header.rst 2026-01-05 17:54:11 -07:00
kexec_relocate.S
kgdb.c riscv: kgdb: fix several debug register assignment bugs 2026-04-04 18:36:52 -06:00
machine_kexec_file.c riscv: kexec_file: Constrain segment placement to direct map 2026-06-06 23:48:15 -06:00
machine_kexec.c riscv: Prevent NULL pointer dereference in machine_kexec_prepare() 2026-07-06 18:24:06 -06:00
Makefile arch/riscv: add dual vdso creation logic and select vdso based on hw 2026-01-29 02:38:40 -07:00
Makefile.syscalls syscalls: fix syscall macros for newfstat/newfstatat 2024-08-02 15:20:47 +02:00
mcount-dyn.S riscv: fix various typos in comments and code 2026-04-04 18:42:39 -06:00
mcount.S riscv: fgraph: Fix stack layout to match __arch_ftrace_regs argument of ftrace_return_to_handler 2025-03-19 12:03:25 +00:00
module-sections.c riscv: module: Use generic cmp_int() instead of custom cmp_3way() 2026-06-06 20:17:53 -06:00
module.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
paravirt.c riscv/paravirt: Use common code for paravirt_steal_clock() 2026-01-12 16:47:33 +01:00
patch.c riscv: patch: Avoid early phys_to_page() 2026-04-04 18:37:03 -06:00
perf_callchain.c The biggest change here is eliminating the awful idea that KVM had, of 2024-11-23 16:00:50 -08:00
perf_regs.c
process.c riscv: cfi: clear CFI lock status in start_thread() 2026-04-04 18:40:58 -06:00
ptrace.c riscv/ptrace: Use USER_REGSET_NOTE_TYPE for REGSET_CFI 2026-06-06 20:17:04 -06:00
reset.c
return_address.c riscv: add CALLER_ADDRx support 2024-02-22 12:17:47 -08:00
riscv_ksyms.c riscv: Omit optimized string routines when using KASAN 2024-09-19 01:10:00 -07:00
sbi_ecall.c riscv: Fix RISCV_ALTERNATIVE_EARLY 2024-09-03 07:57:55 -07:00
sbi-ipi.c RISC-V: Enable the IPI before workqueue_online_cpu() 2024-08-01 07:15:43 -07:00
sbi.c riscv: sbi: Prefer SRST shutdown over legacy 2025-11-16 10:37:27 -07:00
setup.c riscv: propagate insert_resource result from add_resource 2026-06-06 20:17:52 -06:00
signal.c riscv/signal: save and restore the shadow stack on a signal 2026-01-29 02:38:40 -07:00
smp.c genirq/proc: Increase default interrupt number precision to four 2026-05-26 16:21:14 +02:00
smpboot.c riscv: smp: use secs_to_jiffies in __cpu_up 2026-06-25 12:24:25 -06:00
soc.c riscv: fix various typos in comments and code 2026-04-04 18:42:39 -06:00
stacktrace.c riscv: stacktrace: Remove bogus -0x4 offset in non-FP walk_stackframe 2026-06-06 23:48:15 -06:00
suspend_entry.S riscv: Remove support for XIP kernel 2026-04-04 18:42:44 -06:00
suspend.c riscv: fix various typos in comments and code 2026-04-04 18:42:39 -06:00
sys_hwprobe.c riscv: hwprobe: Avoid uninitialized read in hwprobe_get_cpus() 2026-07-15 11:12:40 -06:00
sys_riscv.c riscv/mm: ensure PROT_WRITE leads to VM_READ | VM_WRITE 2026-01-25 21:09:53 -07:00
syscall_table.c riscv: convert to generic syscall table 2024-07-10 14:23:38 +02:00
time.c
traps_misaligned.c riscv: traps_misaligned: Avoid redundant unaligned access speed probe 2026-06-08 10:47:22 -06:00
traps.c RISC-V updates for v7.1 2026-04-24 10:00:37 -07:00
unaligned_access_speed.c riscv: misaligned: Fix fast_unaligned_access_speed_key init 2026-06-08 10:47:22 -06:00
usercfi.c riscv: cfi: reject unknown flags in PR_SET_CFI 2026-06-06 20:17:05 -06:00
vdso.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
vec-copy-unaligned.S riscv: Define __riscv_copy_{,vec_}{words,bytes}_unaligned() using SYM_TYPED_FUNC_START 2026-04-29 20:38:17 -06:00
vector.c riscv: vector: init vector context with proper vlenb 2026-02-09 15:27:33 -07:00
vendor_extensions.c riscv: Add xmipsexectl as a vendor extension 2025-09-18 20:36:00 -06:00
vmcore_info.c riscv: Remove support for XIP kernel 2026-04-04 18:42:44 -06:00
vmlinux-xip.lds.S riscv: remove limit on the size of read-only section for XIP kernel 2024-09-12 07:23:02 -07:00
vmlinux.lds.S riscv: Remove support for XIP kernel 2026-04-04 18:42:44 -06:00