Hacker News new | ask | show | jobs
by ori_b 2148 days ago
Double map it, like a JIT does. Once writable, and once executable. Put the pointers into different shared objects so that ASLR puts a randomized offset between them and you can't discover the write pointers from the execute pointer, and vice versa.
1 comments

You still need to store the write pointers somewhere. So this very quickly becomes a game of cat and mouse.
JavaScriptCore had an amusing scheme where they'd make an (executable) memcpy gadget with the address hardcoded, then throw away read permissions to that memory. So the pointer's address is thus not readable without modifying memory permissions.