Re:Self-modifying code using GCC (2011)
by LegionMammal978 on Monday August 07, 2023 @02:24PM
(#37038498)
The processor itself doesn't enforce W^X protection; even though writable pages are NX by convention, nothing inherently stops you from using (the equivalent of) mmap(PROT_READ | PROT_WRITE | PROT_EXEC) and copying the instructions in, or doing the same with existing pages using mprotect(), at which point you can hotpatch as much as you want. Of course, some OSes forbid this as a hardening measure, but allowing it remains very common.
[ Parent
| on HN ]
There are no comments on this comment yet.