Page MenuHomeFreeBSD

rtld: Fix segfault in direct exec mode
ClosedPublic

Authored by rstone on Jan 2 2020, 4:08 PM.
Tags
None
Referenced Files
F150513939: D23008.id66440.diff
Wed, Apr 1, 9:47 PM
F150427431: D23008.diff
Wed, Apr 1, 3:55 AM
Unknown Object (File)
Tue, Mar 31, 7:24 AM
Unknown Object (File)
Sat, Mar 28, 11:42 AM
Unknown Object (File)
Fri, Mar 27, 12:38 PM
Unknown Object (File)
Mon, Mar 23, 7:36 AM
Unknown Object (File)
Thu, Mar 19, 6:57 AM
Unknown Object (File)
Thu, Mar 19, 6:57 AM
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

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 28440
Build 26509: arc lint + arc unit