Re:Computer security is broken, but things are starting to i...
by charleslmunger on Friday April 07, 2017 @11:31AM
(#14060517)
For a jit, can a page be marked read only and executable after it has been set up?
[ Parent
| on HN ]
Re:Computer security is broken, but things are starting to i...
by EthanHeilman on Friday April 07, 2017 @12:22PM
(#14061027)
It can be, I'm not sure how it would help since the JIT would want to continually write to that page.
Re:Computer security is broken, but things are starting to i...
by cvwright on Friday April 07, 2017 @12:35PM
(#14061166)
The idea is that the JITed code is executed much more often than it's (re)written, right?
So each time the JIT (re)compiles the code, it can call mprotect on the target page to allow writes and disable execution. Then after it's done, it calls mprotect again to disable writes and allow execute.
Re:Computer security is broken, but things are starting to i...
by EthanHeilman on Friday April 07, 2017 @01:26PM
(#14061647)
The shell code is in the code which is compiled.
1. Put shell code in a string in some js,
2. get browser to JIT js and thus write the string that contains the shell code to an execute page in memory,
3. exploit a vulnerability and point the instruction pointer to the location of the string which contains the shellcode.
Normally, i.e. outside of a JIT, this wouldn't work because the string would be saved to a non-executable page.