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
F109227202: D21656.diff
Sun, Feb 2, 7:56 AM
Unknown Object (File)
Sat, Jan 25, 7:57 PM
Unknown Object (File)
Sat, Jan 25, 7:22 PM
Unknown Object (File)
Dec 13 2024, 1:59 PM
Unknown Object (File)
Dec 8 2024, 11:21 AM
Unknown Object (File)
Dec 4 2024, 12:32 PM
Unknown Object (File)
Nov 28 2024, 5:21 PM
Unknown Object (File)
Nov 27 2024, 2:42 AM
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