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
F171778353: D58558.diff
Sun, Sep 13, 11:27 AM
F171770665: D58558.id183160.diff
Sun, Sep 13, 10:03 AM
F171711152: D58558.diff
Sat, Sep 12, 10:33 PM
Unknown Object (File)
Fri, Sep 11, 5:48 PM
Unknown Object (File)
Fri, Sep 11, 8:19 AM
Unknown Object (File)
Thu, Sep 10, 9:46 PM
Unknown Object (File)
Thu, Sep 10, 9:44 PM
Unknown Object (File)
Thu, Sep 10, 4:49 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