Page MenuHomeFreeBSD

loader: fix elf lookup_symbol type filtering
ClosedPublic

Authored by kevans on Oct 13 2022, 2:25 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jun 14, 5:46 AM
Unknown Object (File)
Sat, Jun 1, 4:05 PM
Unknown Object (File)
Fri, May 24, 7:32 PM
Unknown Object (File)
Tue, May 21, 12:42 AM
Unknown Object (File)
Mon, May 20, 10:55 PM
Unknown Object (File)
Fri, May 17, 11:46 PM
Unknown Object (File)
May 12 2024, 12:41 PM
Unknown Object (File)
May 12 2024, 10:29 AM
Subscribers

Details

Summary

The existing logic doesn't seem to make much sense, as we won't filter
on the type if st_shndx != SHN_UNDEF. In practice, this breaks booting
12.3 kernels on newer loaders, as they do have a kernphys symbol of
the wrong type (NOTYPE, rather than OBJECT) -- we end up deriving the
wrong value for copy_staging.

It's unclear if this version makes any more sense, but it seems to match
what rtld's matched_symbol() does. Loader doesn't need to care about
STT_FUNC w/ UND shndx, because we won't encounter those; in kmods,
undefined (kernel) functions are NOTYPE.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 47823
Build 44710: arc lint + arc unit