[PATCH] D33874: Implement AllocateRWX and ReleaseRWX for NetBSD

Joerg Sonnenberger via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 7 05:46:35 PDT 2017


joerg added a comment.

In https://reviews.llvm.org/D33874#774445, @krytarowski wrote:

> In https://reviews.llvm.org/D33874#774433, @joerg wrote:
>
> > Given that W^X is becoming a lot more popular across systems including SELinux and other variants, I think it would be better to extend MemoryBlock to store separate pointers for W and X mappings. That avoids the complexity of storing the pointer directly in the allocation.
>
>
> I was thinking about this and I was evaluating this option. My concern whether it is appropriate to include additional internal pointer for all targets unconditionally or just one extra for NetBSD (and other who can catch up).
>
> I will add this pointer without ifdefs.


There are two possible APIs to consider: add them to MemoryBlock itself or make Memory::AllocateRWX return a pair of MemoryBlocks. With reference counting, the latter would naturally allow dealing with both types, but I don't think we have that currently.  This leaves the question whether every MemoryBlock should have this property or whether a new (sub?)class should be created specifically for RW|RX memory.


Repository:
  rL LLVM

https://reviews.llvm.org/D33874





More information about the llvm-commits mailing list