[LLVMdev] [PATCH] Add the disable_aslr option that will disable the address space layout randomization under AddressSanitizer on 10.6

Kostya Serebryany kcc at google.com
Fri Dec 9 14:54:03 PST 2011


On Fri, Dec 9, 2011 at 2:04 PM, Eric Christopher <echristo at apple.com> wrote:

>
> On Dec 9, 2011, at 11:46 AM, Alexander Potapenko wrote:
>
> >> Link time is of course better.
> >> But if there is a syscall (like the one used by setarch) we could call
> it
> >> and reexec.
> >> Using setenv("DYLD_NO_PIE")+reexec looks gross to me.
> > There's posix_spawnattr_setflags() that can do the job
> > (
> http://reverse.put.as/2011/08/11/how-gdb-disables-aslr-in-mac-os-x-lion/),
> > but the necessary flag appeared only in Lion.
> >
> > To the best of my knowledge, there's no link-time option that disables
> > ASLR but keeps PIE on Snow Leopard or Lion.
> > At the moment we're using DYLD_NO_PIE with Chromium binaries to
> > disable ASLR at runtime.
>
> One bit that may make sense is to support the newest (Lion) style and give
> a descriptive error message for the other two cases? I.e. if we notice that
> MH_PIE is set in the executable, but we're not on Lion and we don't have
> DYLD_NO_PIE set in the environment give an error?
>
> Or some combination of this.
>
Yea, something like this will be simpler to maintain.

--kcc



>
> -eric
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111209/5d074f21/attachment.html>


More information about the llvm-dev mailing list