Re: [PATCH v2] riscv: don't allow write but not read page mapping request in mmap

From: Celeste Liu
Date: Mon Jun 13 2022 - 03:07:19 EST


On Mon, Jun 13, 2022 at 01:44:28PM +0800, Guo Ren wrote:
> Yes, PROT_EXEC would prevent next PROT_READ check.
>
> Looks good to me.
>
> Reviewed-by: Guo Ren <guoren@xxxxxxxxxx>

> > - if (unlikely(!(prot & PROT_READ)))
> > - return -EINVAL;
> Could we put your comment here?
>
> /*
> * As mentioned in Table 4.5 in RISC-V spec Volume 2 Section 4.3 version
> * "20211203 Privileged Architecture v1.12, Ratified"[1], the PTE permission
> * bit combination of "write+!read" is "Reserved for future use.". Hence, don't
> * allow such mapping request in mmap call. In the current code[2], write+exec
> * only is marked as invalid, but write only is not marked as invalid.
> */
>

ok, I will add it in next verison.

--
Best Regards
Coelacanthus

Attachment: signature.asc
Description: PGP signature