android_kernel_motorola_sm6225/arch
Yash Shah db9138d06e RISC-V: Don't allow write+exec only page mapping request in mmap
[ Upstream commit e0d17c842c0f824fd4df9f4688709fc6907201e1 ]

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 23:17:15 -04:00
..
alpha alpha: fix memory barriers so that they conform to the specification 2020-06-22 09:05:28 +02:00
arc ARC: [plat-eznps]: Restrict to CONFIG_ISA_ARCOMPACT 2020-06-07 13:17:55 +02:00
arm ARM: imx5: add missing put_device() call in imx_suspend_alloc_ocram() 2020-06-30 23:17:12 -04:00
arm64 arm64: sve: Fix build failure when ARM64_SVE=y and SYSCTL=n 2020-06-30 23:17:15 -04:00
c6x kbuild: rename LDFLAGS to KBUILD_LDFLAGS 2018-08-24 08:22:08 +09:00
h8300 h8300: use cc-cross-prefix instead of hardcoding h8300-unknown-linux- 2019-04-05 22:32:55 +02:00
hexagon hexagon: define ioremap_uc 2020-05-10 10:30:11 +02:00
ia64 mm/memory_hotplug: shrink zones when offlining memory 2020-01-29 16:43:27 +01:00
m68k m68k/PCI: Fix a memory leak in an error handling path 2020-06-25 15:32:50 +02:00
microblaze microblaze: Prevent the overflow of the start 2020-02-24 08:34:53 +01:00
mips MIPS: Fix IRQ tracing when call handle_fpe() and handle_msa_fpe() 2020-06-22 09:05:19 +02:00
nds32 nds32: Fix the items of hwcap_str ordering issue. 2019-12-13 08:51:35 +01:00
nios2 nios2: ksyms: Add missing symbol exports 2020-01-27 14:50:30 +01:00
openrisc openrisc: Fix issue with argument clobbering for clone/fork 2020-06-25 15:33:01 +02:00
parisc parisc: Fix kernel panic in mem_init() 2020-06-03 08:19:42 +02:00
powerpc powerpc/4xx: Don't unmap NULL mbase 2020-06-25 15:33:00 +02:00
riscv RISC-V: Don't allow write+exec only page mapping request in mmap 2020-06-30 23:17:15 -04:00
s390 s390/vdso: fix vDSO clock_getres() 2020-06-30 23:17:14 -04:00
sh Fix 'acccess_ok()' on alpha and SH 2020-06-22 09:04:58 +02:00
sparc fix a braino in "sparc32: fix register window handling in genregs32_[gs]et()" 2020-06-30 23:17:02 -04:00
um um: ubd: Prevent buffer overrun on command completion 2020-04-23 10:30:19 +02:00
unicore32 mm: convert return type of handle_mm_fault() caller to vm_fault_t 2018-08-17 16:20:28 -07:00
x86 x86/resctrl: Fix a NULL vs IS_ERR() static checker warning in rdt_cdp_peer_get() 2020-06-30 23:17:10 -04:00
xtensa xtensa: fix TLB sanity checker 2019-12-21 10:57:25 +01:00
.gitignore
Kconfig jump_label: move 'asm goto' support test to Kconfig 2019-06-04 08:02:34 +02:00