Page MenuHomeFreeBSD

Don't assume objects in program sections have a size of a pointer.

Authored by jhb on Sep 1 2020, 4:25 PM.



The size of the object at 'addr' is unknown and might be smaller than
the size of a pointer (e.g. some x86 instructions are smaller than a
pointer). Instead, just check that the address is in the bounds of
the program header.

Test Plan
  • some TLS tests failed under CHERI because function pointers can't (easily) be added to under CHERI that now pass, but examining the failure led to the notion that the sizeof() was arbitrary and not always correct.

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.