5

Is there any way i can mark a page execute only with no read permissions ? (i.e able to execute instructions on that page without having read permissions of that page which is executable.)

My final goal is to make a page that i can execute but no other process should be able to make any data access to that page ..

1
  • 1
    Just out of curiosity, how do you plan to allow execute permissions without reading the page? I mean... you need to read instructions to execute them, right? Commented Apr 15, 2011 at 19:35

1 Answer 1

4

This is one of the things that is kernel and hardware-dependent, as mentioned in the mprotect() manual page:

Whether PROT_EXEC has any effect different from PROT_READ is architecture and kernel version dependent.

On recent Linux/x86 kernels, those flags are definitely discrete if your CPU supports the NX-bit. On the other x86 CPUs, it depends on whether your kernel has support for Exec-Shield or another similar NX-bit emulation.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.