mirror of
https://github.com/torvalds/linux.git
synced 2026-11-28 01:13:11 +00:00
Since commit5d8544e2d0("RISC-V: Generic library routines and assembly") and commitebcbd75e39("riscv: Fix the bug in memory access fixup code"), if __clear_user and __copy_user return from an fixup branch, CSR_STATUS SR_SUM bit will be set, it is a vulnerability, so that S-mode memory accesses to pages that are accessible by U-mode will success. Disable S-mode access to U-mode memory should clear SR_SUM bit. Fixes:5d8544e2d0("RISC-V: Generic library routines and assembly") Fixes:ebcbd75e39("riscv: Fix the bug in memory access fixup code") Signed-off-by: Chen Lifu <[email protected]> Reviewed-by: Ben Dooks <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: [email protected] Signed-off-by: Palmer Dabbelt <[email protected]>