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 ..
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With