Skip to content

Disable ASLR #107

@ligurio

Description

@ligurio

Since you're seeing variations due to ASLR, the only relevant things this affects is trace region selection and table iteration order (with collectable non-string objects as keys). The latter is also affected by the recent security improvements for strings as keys. Are you 100% sure none of your code relies on a particular iteration order (which is not guaranteed by pairs)?

How to disable in a process (via):

#include <stdio.h>
#include <sys/personality.h>

int main(int argc, char **argv) {
    const int old_personality = personality(ADDR_NO_RANDOMIZE);
    if (!(old_personality & ADDR_NO_RANDOMIZE)) {
        const int new_personality = personality(ADDR_NO_RANDOMIZE);
        if (new_personality & ADDR_NO_RANDOMIZE) {
            execv(argv[0], argv);
        }
    }
    printf("&argc == %p\n", (void *) &argc);
}

See LJ#610, LJ#624 and personality(2).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions