Page MenuHomeFreeBSD

rtld: Fix segfault in direct exec mode
ClosedPublic

Authored by rstone on Jan 2 2020, 4:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jan 23, 7:58 AM
Unknown Object (File)
Mon, Jan 20, 9:27 AM
Unknown Object (File)
Sat, Jan 18, 7:41 PM
Unknown Object (File)
Sat, Jan 11, 12:26 AM
Unknown Object (File)
Dec 23 2024, 4:32 PM
Unknown Object (File)
Dec 11 2024, 4:42 PM
Unknown Object (File)
Nov 27 2024, 5:06 AM
Unknown Object (File)
Nov 17 2024, 8:57 PM
Subscribers

Details

Summary

When rtld is directly executed with arguments, it has to move the
program arguments, environment and elf aux data up a few slots to
remove its own arguments before the process being executed sees
them. When copying the environment, rtld was incorrectly testing
whether the location about to be written to currently contained
NULL, when was supposed to check whether it had just copied the
NULL terminator of the environment string. This had the result
that the ELF aux data was mostly treated as environment variables,
and rtld would quickly crash when it tried to access required
ELF aux data that it didn't think was present.

Diff Detail

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