Re:OpenBSD's kernel gets W^X treatment
by achernya on Wednesday January 14, 2015 @12:45AM
(#8884540)
You're correct, the protection is implemented in hardware, but the pages have to be marked appropriately. This message describes a patchset that correctly marks the kernel pages as writable xor executable.
[ Parent
| on HN ]
So they can but don't have to be marked?
Yes. Many programs rely on W&X (I believe the JVM is a prominent example)
Re:OpenBSD's kernel gets W^X treatment
by masklinn on Wednesday January 14, 2015 @06:55AM
(#8885669)
Any JIT-based system requires executable writable memory. This includes the JVM, LuaJIT, Pypy, HHVM and all modern browsers.
It'd be quite possible for a JIT to have the memory first writable but not executable when creating the code, then the other way around when running it. No need to be both at the same time.