[LTP] [PATCH] mprotect04: Support execute-only page access permissions

Daniel Mentz danielmentz@google.com
Fri Feb 8 01:12:41 CET 2019


On Wed, Feb 6, 2019 at 11:04 PM Jan Stancek <jstancek@redhat.com> wrote:
> > +     /* Mark page readable on platforms that support execute-only page access
> > +      * permissions. */
> > +     if (exec_only_platform)
> > +             mprotect(page_to_copy, page_sz, PROT_READ | PROT_EXEC);
>
> Is there a chance 2nd page will be something else than code?
> E.g. some section that was previously also writeable.

Ok. I can see that concern. We could read /proc/$$/maps to determine
if the 2nd page is writable, but that'd be a lot of work to implement.
What about making the 2nd page writable (PROT_WRITE) just in case? Is
that a solution you would support? Can you think of another solution?


More information about the ltp mailing list