Home
last modified time | relevance | path

Searched hist:"75 b59f2a" (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/arch/riscv/kernel/
H A Dvector.c75b59f2a Mon Jun 26 20:55:54 CDT 2023 Andy Chiu <andy.chiu@sifive.com> riscv: vector: clear V-reg in the first-use trap

If there is no context switch happens after we enable V for a process,
then we return to user space with whatever left on the CPU's V registers
accessible to the process. The leaked data could belong to another
process's V-context saved from last context switch, impacting process's
confidentiality on the system.

To prevent this from happening, we clear V registers by restoring
zero'd V context after turining on V.

Fixes: cd054837243b ("riscv: Allocate user's vector context in the first-use trap")
Signed-off-by: Andy Chiu <andy.chiu@sifive.com>
Reviewed-by: Björn Töpel <bjorn@rivosinc.com>
Link: https://lore.kernel.org/r/20230627015556.12329-2-andy.chiu@sifive.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>