Page MenuHomeFreeBSD

libc: Reject static ELF exectables with PT_TLS segments were filesz > memsz
ClosedPublic

Authored by jhb on Jul 30 2026, 6:19 PM.
Tags
None
Referenced Files
F170886749: D58558.diff
Mon, Sep 7, 7:56 AM
Unknown Object (File)
Sat, Sep 5, 12:57 PM
Unknown Object (File)
Sat, Sep 5, 3:59 AM
Unknown Object (File)
Fri, Sep 4, 3:06 PM
Unknown Object (File)
Fri, Sep 4, 9:28 AM
Unknown Object (File)
Fri, Sep 4, 6:34 AM
Unknown Object (File)
Fri, Sep 4, 4:58 AM
Unknown Object (File)
Thu, Sep 3, 1:59 PM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb requested review of this revision.Jul 30 2026, 6:19 PM
lib/libc/gen/tls.c
439

Any reason this is different to the rtld message ("invalid PT_TLS segment", with no full stop)? Obviously the lack of printf means we can't shove argv[0] at the start, but the rest should probably be the same?

But LGTM aside from that

This revision is now accepted and ready to land.Jul 30 2026, 10:01 PM
lib/libc/gen/tls.c
439

Oh, I can switch to "invalid". The full stop is to match all the other tls_msg() invocations in this file that all use a full stop. Whereas rtld consistently does _not_ use full stops in its _rtld_error() calls.

This revision now requires review to proceed.Jul 31 2026, 2:53 PM
jrtc27 added inline comments.
lib/libc/gen/tls.c
439

Oh dear, fair enough.

This revision is now accepted and ready to land.Jul 31 2026, 3:11 PM