linux-bl808/arch/riscv/kernel
Jisheng Zhang 6510c78490
riscv: process: fix kernel info leakage
thread_struct's s[12] may contain random kernel memory content, which
may be finally leaked to userspace. This is a security hole. Fix it
by clearing the s[12] array in thread_struct when fork.

As for kthread case, it's better to clear the s[12] array as well.

Fixes: 7db91e57a0 ("RISC-V: Task implementation")
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Tested-by: Guo Ren <guoren@kernel.org>
Link: https://lore.kernel.org/r/20221029113450.4027-1-jszhang@kernel.org
Reviewed-by: Guo Ren <guoren@kernel.org>
Link: https://lore.kernel.org/r/CAJF2gTSdVyAaM12T%2B7kXAdRPGS4VyuO08X1c7paE-n4Fr8OtRA@mail.gmail.com/
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2022-11-10 13:43:15 -08:00
..
compat_vdso
probes
vdso
.gitignore
alternative.c
asm-offsets.c
cacheinfo.c
compat_signal.c
compat_syscall_table.c
cpu-hotplug.c
cpu.c
cpu_ops.c
cpu_ops_sbi.c
cpu_ops_spinwait.c
cpufeature.c
crash_dump.c
crash_save_regs.S
efi-header.S
efi.c
elf_kexec.c
entry.S
fpu.S
ftrace.c
head.h
head.S
image-vars.h
irq.c
jump_label.c
kexec_relocate.S
kgdb.c
machine_kexec.c
machine_kexec_file.c
Makefile
mcount-dyn.S
mcount.S
module-sections.c
module.c
patch.c
perf_callchain.c
perf_regs.c
process.c riscv: process: fix kernel info leakage 2022-11-10 13:43:15 -08:00
ptrace.c
reset.c
riscv_ksyms.c
sbi.c
setup.c
signal.c
smp.c
smpboot.c
soc.c
stacktrace.c
suspend.c
suspend_entry.S
sys_riscv.c
syscall_table.c
time.c
trace_irq.c
trace_irq.h
traps.c
traps_misaligned.c
vdso.c
vmlinux-xip.lds.S
vmlinux.lds.S