Skip to content

os x: re-enable PIE (ASLR) #6466

@bnoordhuis

Description

@bnoordhuis

Commit a5012a0 disables PIE (and therefore ASLR) on OS X because it breaks profiling of C++ code. Ideally, we'd figure out a way to keep it turned on except when -prof is specified on the command line.

I believe the only way to do that (except for having two separate binaries, which I don't think we want) is to re-exec the process with the _POSIX_SPAWN_DISABLE_ASLR (256) flag set. The flag is ignored for setuid/setgid binaries so in that respect -Wl,-no_pie is superior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c++Issues and PRs that require attention from people who are familiar with C++.macosIssues and PRs related to the macOS platform / OSX.securityIssues and PRs related to security.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions