]> git.baikalelectronics.ru Git - kernel.git/commit
riscv: Make VM_WRITE imply VM_READ
authorAndrew Bresticker <abrestic@rivosinc.com>
Thu, 15 Sep 2022 19:37:01 +0000 (15:37 -0400)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 22 Sep 2022 16:44:50 +0000 (09:44 -0700)
commit2d9a573e53823cf521d076fa41a74090de02f3aa
treec65d1600b224e02e67b6130f31b8d1559104ae87
parent3d7dcb2c5450a57f60c448f42be48fdfe456bfdf
riscv: Make VM_WRITE imply VM_READ

RISC-V does not presently have write-only mappings as that PTE bit pattern
is considered reserved in the privileged spec, so allow handling of read
faults in VMAs that have VM_WRITE without VM_READ in order to be consistent
with other architectures that have similar limitations.

Fixes: 106b53788afb ("riscv: mmap with PROT_WRITE but no PROT_READ is invalid")
Reviewed-by: Atish Patra <atishp@rivosinc.com>
Signed-off-by: Andrew Bresticker <abrestic@rivosinc.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20220915193702.2201018-2-abrestic@rivosinc.com/
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/mm/fault.c