This is an archive of the discontinued LLVM Phabricator instance.

[msan] Intercept __getrlimit.
ClosedPublic

Authored by eugenis on Sep 27 2019, 4:15 PM.

Details

Summary

This interceptor is useful on its own, but the main purpose of this
change is to intercept libpthread initialization on linux/glibc in
order to run __msan_init before any .preinit_array constructors.

We used to trigger on pthread_initialize_minimal -> getrlimit(), but
that call has changed to __getrlimit at some point.

Diff Detail

Repository
rL LLVM

Event Timeline

eugenis created this revision.Sep 27 2019, 4:15 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptSep 27 2019, 4:15 PM
Herald added subscribers: Restricted Project, jfb. · View Herald Transcript
vitalybuka added inline comments.Sep 27 2019, 7:30 PM
compiler-rt/lib/msan/msan_interceptors.cpp
770 ↗(On Diff #222263)

why not sanitizer_common?
looks like races and use-after free are possible here

vitalybuka accepted this revision.Sep 27 2019, 7:32 PM

Oh, because other are already there.
Consider to move them into common in a separate patch.

This revision is now accepted and ready to land.Sep 27 2019, 7:32 PM
This revision was automatically updated to reflect the committed changes.