Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable ASLR #107

Open
ligurio opened this issue Nov 1, 2024 · 0 comments
Open

Disable ASLR #107

ligurio opened this issue Nov 1, 2024 · 0 comments

Comments

@ligurio
Copy link
Owner

ligurio commented Nov 1, 2024

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant