This is an archive of the discontinued LLVM Phabricator instance.

[esan] Ensure internal_sigaction() bypasses interceptors
ClosedPublic

Authored by bruening on May 31 2016, 1:27 PM.

Details

Summary

Implements real_sigaction() which it turns out is required for
internal_sigaction() to bypass the libc interceptors.

Diff Detail

Repository
rL LLVM

Event Timeline

bruening updated this revision to Diff 59120.May 31 2016, 1:27 PM
bruening retitled this revision from to [esan] Ensure internal_sigaction() bypasses interceptors.
bruening updated this object.
bruening added a reviewer: aizatsky.
bruening added subscribers: llvm-commits, eugenis, kcc and 2 others.
aizatsky accepted this revision.Jun 2 2016, 1:57 PM
aizatsky edited edge metadata.

Is there (or will there by) a test that exercises this?

This revision is now accepted and ready to land.Jun 2 2016, 1:57 PM

Is there (or will there by) a test that exercises this?

Without this CL, our internal_sigaction calls that we make every run are only during init, where the EsanDuringInit check in COMMON_INTERCEPTOR_ENTER does end up calling the original libc sigaction and we do avoid running our interception action on our own calls that way (but it does not feel right for an "internal_" call to go through the interceptor). The real problem is when we call internal_sigaction after we're initialized, which only happens on an unhandled SIGSEGV for which the app has no handler: then we'll spin in an infinite loop as our attempts to remove our own handler repeatedly fail. It's not easy to add such a test. I'll add some of this explanation to the CL.

This revision was automatically updated to reflect the committed changes.