Skip to content
Commit cc36c7fa authored by Jisheng Zhang's avatar Jisheng Zhang Committed by Greg Kroah-Hartman
Browse files

riscv: process: fix kernel info leakage

[ Upstream commit 6510c784 ]

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: 7db91e57

 ("RISC-V: Task implementation")
Signed-off-by: default avatarJisheng Zhang <jszhang@kernel.org>
Tested-by: default avatarGuo Ren <guoren@kernel.org>
Link: https://lore.kernel.org/r/20221029113450.4027-1-jszhang@kernel.org


Reviewed-by: default avatarGuo Ren <guoren@kernel.org>
Link: https://lore.kernel.org/r/CAJF2gTSdVyAaM12T%2B7kXAdRPGS4VyuO08X1c7paE-n4Fr8OtRA@mail.gmail.com/


Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent a8d67367
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment