Skip to content

auxval AT_RANDOM isn't deterministic #3539

@sporksmith

Description

@sporksmith

Given the following test program:

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

int main() {
    unsigned long *x = (void*)getauxval(AT_RANDOM);
    printf("*getauxval(AT_RANDOM) %lx\n", *x);
}

shadow currently produces non-deterministic results:

$ shadow-exec ./a.out 
*getauxval(AT_RANDOM) 280741edbe5ef200
$ shadow-exec ./a.out 
*getauxval(AT_RANDOM) f2cf2d8a17f3400c

i.e. this is initialized with some random value before shadow gets control. Maybe by the dynamic linker/loader? Or maybe even by the linux kernel itself?

I'm not aware of any real-world programs that use this value, though it would be a subtle source of nondeterminism to detect if and when we do bump into it. (I was hoping maybe it was the source of nondeterminism in #2693 , but it doesn't appear to be)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions