This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]