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

Celeste Liu coelacanthus at outlook.com
Mon Jun 13 00:06:32 PDT 2022


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 at kernel.org>

> > -               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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20220613/127d0890/attachment.sig>


More information about the linux-riscv mailing list