linux/arch/riscv
Chen Lifu c08b4848f5
riscv: lib: uaccess: fix CSR_STATUS SR_SUM bit
Since commit 5d8544e2d0 ("RISC-V: Generic library routines and assembly")
and commit ebcbd75e39 ("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 <chenlifu@huawei.com>
Reviewed-by: Ben Dooks <ben.dooks@codethink.co.uk>
Link: https://lore.kernel.org/r/20220615014714.1650349-1-chenlifu@huawei.com
Cc: stable@vger.kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2022-08-10 14:06:31 -07:00
..
boot RISC-V Patches for the 5.20 Merge Window, Part 1 2022-08-06 15:04:48 -07:00
configs riscv: enable Docker requirements in defconfig 2022-07-22 13:43:28 -07:00
errata RISC-V Patches for the 5.20 Merge Window, Part 1 2022-08-06 15:04:48 -07:00
include RISC-V Patches for the 5.20 Merge Window, Part 1 2022-08-06 15:04:48 -07:00
kernel RISC-V Patches for the 5.20 Merge Window, Part 1 2022-08-06 15:04:48 -07:00
kvm Merge remote-tracking branch 'kvm/next' into kvm-next-5.20 2022-08-01 03:21:00 -04:00
lib riscv: lib: uaccess: fix CSR_STATUS SR_SUM bit 2022-08-10 14:06:31 -07:00
mm riscv/mm: enable ARCH_HAS_VM_GET_PAGE_PROT 2022-07-17 17:14:39 -07:00
net bpf, riscv: Support riscv jit to provide bpf_line_info 2022-06-02 16:26:01 -07:00
purgatory RISC-V: Add purgatory 2022-05-19 12:18:59 -07:00
Kbuild riscv: move errata/ and kvm/ builds to arch/riscv/Kbuild 2022-06-01 22:26:32 -07:00
Kconfig RISC-V Patches for the 5.20 Merge Window, Part 1 2022-08-06 15:04:48 -07:00
Kconfig.debug RISC-V: Remove EARLY_PRINTK support 2018-12-17 10:23:46 -08:00
Kconfig.erratas riscv: Kconfig: Style cleanups 2022-06-30 19:26:16 -07:00
Kconfig.socs riscv: Kconfig: Style cleanups 2022-06-30 19:26:16 -07:00
Makefile riscv: compat: vdso: Fix vdso_install target 2022-07-22 12:23:14 -07:00