This is an archive of the discontinued LLVM Phabricator instance.

[Darwin][ASan] Fix "interceptor working?" check for DriverKit platform
ClosedPublic

Authored by thetruestblue on Apr 6 2022, 12:49 PM.

Details

Summary

The previous check for interceptors used 'pthread_create' which is not available on DriverKit.
Needed a new interceptor wrapped symbol that satisfies the following constraints:

  • Symbol is available in DriverKit
  • Symbol is provided by simulator runtime dylibs (dlsym() fails to look up host-provided symbols)

puts() satisfies all of the above constraints.

rdar://87895539

Diff Detail

Event Timeline

thetruestblue created this revision.Apr 6 2022, 12:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 6 2022, 12:49 PM
thetruestblue requested review of this revision.Apr 6 2022, 12:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 6 2022, 12:49 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
yln added a comment.Apr 6 2022, 1:40 PM

Suggested title for commit: [Darwin][ASan] Fix "interceptor working?" check for DriverKit platform

Please explain in the commit message why we picked puts(). We want to point out our constraints:

  • Available on DriverKit (pthread_create() isn't)
  • In the simulators, dlsym()fails to lookup host-provided symbols (symbols not provided by the simulator runtime dylibs)
yln accepted this revision.Apr 6 2022, 3:00 PM
This revision is now accepted and ready to land.Apr 6 2022, 3:00 PM
thetruestblue retitled this revision from [Darwin][ASan][Sanitizer][Interceptors] Change asan interposition checking to use puts instead of pthread_create. to [Darwin][ASan] Fix "interceptor working?" check for DriverKit platform.Apr 6 2022, 3:31 PM
thetruestblue edited the summary of this revision. (Show Details)
yln added a comment.Apr 6 2022, 3:46 PM

Blue doesn't have commit access yet. I will land her change.