Page MenuHomeFreeBSD

loader: fix elf lookup_symbol type filtering
ClosedPublic

Authored by kevans on Oct 13 2022, 2:25 AM.
Tags
None
Referenced Files
F151109373: D36975.id111779.diff
Mon, Apr 6, 3:27 AM
Unknown Object (File)
Mon, Mar 23, 2:04 PM
Unknown Object (File)
Sun, Mar 22, 7:52 PM
Unknown Object (File)
Sat, Mar 21, 12:43 PM
Unknown Object (File)
Sat, Mar 21, 6:50 AM
Unknown Object (File)
Thu, Mar 19, 4:21 PM
Unknown Object (File)
Thu, Mar 19, 4:13 PM
Unknown Object (File)
Thu, Mar 19, 7:20 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 Not Applicable
Unit
Tests Not Applicable