[PATCH v2] riscv: mm: Ensure prot of VM_WRITE and VM_EXEC must be readable

Palmer Dabbelt palmer at rivosinc.com
Thu Jun 8 07:04:55 PDT 2023


On Tue, 25 Apr 2023 18:28:28 +0800, Woodrow Shen wrote:
> Commit 8aeb7b17f04e ("RISC-V: Make mmap() with PROT_WRITE imply PROT_READ")
> allows riscv to use mmap with PROT_WRITE only, and meanwhile mmap with w+x
> is also permitted. However, when userspace tries to access this page with
> PROT_WRITE|PROT_EXEC, which causes infinite loop at load page fault as
> well as it triggers soft lockup. According to riscv privileged spec,
> "Writable pages must also be marked readable". The fix to drop the
> `PAGE_COPY_READ_EXEC` and then `PAGE_COPY_EXEC` would be just used instead.
> This aligns the other arches (i.e arm64) for protection_map.
> 
> [...]

Applied, thanks!

[1/1] riscv: mm: Ensure prot of VM_WRITE and VM_EXEC must be readable
      https://git.kernel.org/palmer/c/6569fc12e442

Best regards,
-- 
Palmer Dabbelt <palmer at rivosinc.com>




More information about the linux-riscv mailing list