[Bug cli/23365] New: macOS does not disable ASLR

tromey at sourceware dot org sourceware-bugzilla@sourceware.org
Tue Jul 3 16:33:00 GMT 2018


https://sourceware.org/bugzilla/show_bug.cgi?id=23365

            Bug ID: 23365
           Summary: macOS does not disable ASLR
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: cli
          Assignee: unassigned at sourceware dot org
          Reporter: tromey at sourceware dot org
  Target Milestone: ---

darwin_nat_target doesn't override supports_disable_randomization,
but it could.

lldb uses a special Darwin posix_spawn flag for this:

#ifndef _POSIX_SPAWN_DISABLE_ASLR
#define _POSIX_SPAWN_DISABLE_ASLR 0x0100
#endif

...

  short flags = POSIX_SPAWN_START_SUSPENDED | POSIX_SPAWN_SETEXEC |
                POSIX_SPAWN_SETSIGDEF | POSIX_SPAWN_SETSIGMASK;

  // Disable ASLR if we were asked to
  if (disable_aslr)
    flags |= _POSIX_SPAWN_DISABLE_ASLR;

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Gdb-prs mailing list