[LLVMdev] rwx pages dangerous?

Chris Lattner clattner at apple.com
Tue Jul 17 22:01:44 PDT 2012


On Jul 17, 2012, at 8:07 PM, Josh Haberman wrote:

> I noticed that JITMemoryManager allocates its slabs as rwx.  Isn't it a security problem to have memory mapped as both writable and executable?  I think JITs often avoid this by mapping their memory as rw, then switching it to rx once the data has been written.  I was facing a similar problem in a JIT of my own and was curious to see how LLVM addresses this issue.

Hi Josh,

You're absolutely right that this can be an issue.  The LLVM JIT allows you to implement your own JITMemoryManager policy class, and this policy enables you to implement things like this.

-Chris




More information about the llvm-dev mailing list