summaryrefslogtreecommitdiffstats
path: root/fs/coda
diff options
context:
space:
mode:
authorAndrew Bresticker <abrestic@rivosinc.com>2022-09-15 15:37:02 -0400
committerPalmer Dabbelt <palmer@rivosinc.com>2022-09-22 09:44:59 -0700
commit9e2e6042a7ec6504fe8e366717afa2f40cf16488 (patch)
tree753bd494df1918d2330e0ca0b5739bdfb2b2b53a /fs/coda
parent7ab72c597356be1e7f0f3d856e54ce78527f43c8 (diff)
downloadlinux-stable-9e2e6042a7ec6504fe8e366717afa2f40cf16488.tar.gz
linux-stable-9e2e6042a7ec6504fe8e366717afa2f40cf16488.tar.bz2
linux-stable-9e2e6042a7ec6504fe8e366717afa2f40cf16488.zip
riscv: Allow PROT_WRITE-only mmap()
Commit 2139619bcad7 ("riscv: mmap with PROT_WRITE but no PROT_READ is invalid") made mmap() return EINVAL if PROT_WRITE was set wihtout PROT_READ with the justification that a write-only PTE is considered a reserved PTE permission bit pattern in the privileged spec. This check is unnecessary since we let VM_WRITE imply VM_READ on RISC-V, and it is inconsistent with other architectures that don't support write-only PTEs, creating a potential software portability issue. Just remove the check altogether and let PROT_WRITE imply PROT_READ as is the case on other architectures. Note that this also allows PROT_WRITE|PROT_EXEC mappings which were disallowed prior to the aforementioned commit; PROT_READ is implied in such mappings as well. Fixes: 2139619bcad7 ("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-3-abrestic@rivosinc.com/ Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'fs/coda')
0 files changed, 0 insertions, 0 deletions