开发者

Linux Memory Management

Is there any way i can mark a page execute only with no rea开发者_JS百科d 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜