linux/arch
Palmer Dabbelt 8aeb7b17f0
RISC-V: Make mmap() with PROT_WRITE imply PROT_READ
Commit 2139619bca ("riscv: mmap with PROT_WRITE but no PROT_READ is
invalid") made mmap() reject mappings with only PROT_WRITE set in an
attempt to fix an observed inconsistency in behavior when attempting
to read from a PROT_WRITE-only mapping. The root cause of this behavior
was actually that while RISC-V's protection_map maps VM_WRITE to
readable PTE permissions (since write-only PTEs are considered reserved
by the privileged spec), the page fault handler considered loads from
VM_WRITE-only VMAs illegal accesses. Fix the underlying cause by
handling faults in VM_WRITE-only VMAs (patch 1) and then re-enable
use of mmap(PROT_WRITE) (patch 2), making RISC-V's behavior consistent
with all other architectures that don't support write-only PTEs.

* remotes/palmer/riscv-wonly:
  riscv: Allow PROT_WRITE-only mmap()
  riscv: Make VM_WRITE imply VM_READ

Link: https://lore.kernel.org/r/20220915193702.2201018-1-abrestic@rivosinc.com/
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2022-10-13 12:49:12 -07:00
..
alpha TTY/Serial driver update for 6.1-rc1 2022-10-07 16:36:24 -07:00
arc Kbuild updates for v5.20 2022-08-10 10:40:41 -07:00
arm EFI updates for v6.1 2022-10-09 08:56:54 -07:00
arm64 RISC-V Patches for the 6.1 Merge Window, Part 1 2022-10-09 13:24:01 -07:00
csky Merge 'irq/loongarch', 'pci/ctrl/loongson' and 'pci/header-cleanup-immutable' 2022-08-11 21:06:14 +08:00
hexagon regmap: Updates for v6.1 2022-10-04 19:12:16 -07:00
ia64 TTY/Serial driver update for 6.1-rc1 2022-10-07 16:36:24 -07:00
loongarch EFI updates for v6.1 2022-10-09 08:56:54 -07:00
m68k m68k updates for v6.1 2022-10-03 09:48:47 -07:00
microblaze microblaze: Add support for error injection 2022-09-26 14:13:29 +02:00
mips The first batch of KVM patches, mostly covering x86, which I 2022-10-09 09:39:55 -07:00
nios2 nios2: add force_successful_syscall_return() 2022-08-15 11:25:32 -05:00
openrisc Updates to various subsystems which I help look after. lib, ocfs2, 2022-08-07 10:03:24 -07:00
parisc TTY/Serial driver update for 6.1-rc1 2022-10-07 16:36:24 -07:00
powerpc The first batch of KVM patches, mostly covering x86, which I 2022-10-09 09:39:55 -07:00
riscv RISC-V: Make mmap() with PROT_WRITE imply PROT_READ 2022-10-13 12:49:12 -07:00
s390 The first batch of KVM patches, mostly covering x86, which I 2022-10-09 09:39:55 -07:00
sh hardening updates for v6.1-rc1 2022-10-03 17:24:22 -07:00
sparc TTY/Serial driver update for 6.1-rc1 2022-10-07 16:36:24 -07:00
um hardening updates for v6.1-rc1 2022-10-03 17:24:22 -07:00
x86 The first batch of KVM patches, mostly covering x86, which I 2022-10-09 09:39:55 -07:00
xtensa Merge 'irq/loongarch', 'pci/ctrl/loongson' and 'pci/header-cleanup-immutable' 2022-08-11 21:06:14 +08:00
.gitignore
Kconfig kcfi updates for v6.1-rc1 2022-10-03 17:11:07 -07:00