Page MenuHomeFreeBSD

Fix aux_info corruption in rtld direct execution mode
ClosedPublic

Authored by bdragon on Sep 14 2019, 3:54 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 6, 8:41 AM
Unknown Object (File)
Fri, Oct 3, 12:52 PM
Unknown Object (File)
Fri, Oct 3, 9:37 AM
Unknown Object (File)
Thu, Oct 2, 11:34 AM
Unknown Object (File)
Fri, Sep 19, 4:55 AM
Unknown Object (File)
Fri, Sep 19, 3:27 AM
Unknown Object (File)
Sep 15 2025, 4:49 AM
Unknown Object (File)
Sep 14 2025, 6:57 PM
Subscribers

Details

Summary

This manifests on powerpc64 as not being able to create threads in programs when using direct execution due to an invalid value being used for stack_prot, causing the kernel to reject mmap of the new thread stack.

The problem is that after

for (;; auxp++, auxpf++) {
    *auxp = *auxpf;
    if (auxp->a_type == AT_NULL)
            break;
}

is run, aux_info contains stale pointers to memory that has shifted slightly out from under it.
So, re-digest it to ensure the pointers are sane again.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable