1
0
Fork 0
alistair23-linux/arch/riscv
Yash Shah f06a6294e1 RISC-V: Don't allow write+exec only page mapping request in mmap
[ Upstream commit e0d17c842c ]

As per the table 4.4 of version "20190608-Priv-MSU-Ratified" of the
RISC-V instruction set manual[0], the PTE permission bit combination of
"write+exec only" is reserved for future use. Hence, don't allow such
mapping request in mmap call.

An issue is been reported by David Abdurachmanov, that while running
stress-ng with "sysbadaddr" argument, RCU stalls are observed on RISC-V
specific kernel.

This issue arises when the stress-sysbadaddr request for pages with
"write+exec only" permission bits and then passes the address obtain
from this mmap call to various system call. For the riscv kernel, the
mmap call should fail for this particular combination of permission bits
since it's not valid.

[0]: http://dabbelt.com/~palmer/keep/riscv-isa-manual/riscv-privileged-20190608-1.pdf

Signed-off-by: Yash Shah <yash.shah@sifive.com>
Reported-by: David Abdurachmanov <david.abdurachmanov@gmail.com>
[Palmer: Refer to the latest ISA specification at the only link I could
find, and update the terminology.]
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-30 15:37:06 -04:00
..
boot riscv: dts: HiFive Unleashed: add default chosen/stdout-path 2019-10-14 12:30:30 -07:00
configs RISC-V: Enable VIRTIO drivers in RV64 and RV32 defconfig 2019-09-19 05:44:35 -07:00
include riscv/atomic: Fix sign extension for RV64I 2020-06-30 15:37:03 -04:00
kernel RISC-V: Don't allow write+exec only page mapping request in mmap 2020-06-30 15:37:06 -04:00
lib riscv: Using CSR numbers to access CSRs 2019-08-30 11:04:19 -07:00
mm riscv: set max_pfn to the PFN of the last page 2020-05-14 07:58:27 +02:00
net riscv, bpf: Fix broken BPF tail calls 2020-02-11 04:35:28 -08:00
Kbuild riscv: add arch/riscv/Kbuild 2019-08-30 17:34:00 -07:00
Kconfig riscv: Force flat memory model with no-mmu 2020-03-25 08:25:48 +01:00
Kconfig.debug RISC-V: Remove EARLY_PRINTK support 2018-12-17 10:23:46 -08:00
Kconfig.socs riscv: select SiFive platform drivers with SOC_SIFIVE 2019-07-01 13:20:01 -07:00
Makefile Kbuild updates for v5.4 2019-09-20 08:36:47 -07:00