This is an archive of the discontinued LLVM Phabricator instance.

Bypass potential libc's sysconf interceptors
ClosedPublic

Authored by alekseyshl on Mar 21 2017, 4:11 PM.

Details

Summary

sysconf(_SC_PAGESIZE) is called very early during sanitizer init and
any instrumented code (sysconf() wrapper/interceptor will likely be
instrumented) calling back to sanitizer before init is done will
most surely crash.

2nd attempt, now with glibc version checks (D31092 was reverted).

Event Timeline

alekseyshl created this revision.Mar 21 2017, 4:11 PM
kcc added a subscriber: kcc.Mar 21 2017, 4:19 PM
kcc added inline comments.
lib/sanitizer_common/sanitizer_linux.cc
84

I would put the two ifdefs in sync

#if SANITIZER_LINUX && __GLIBC_PREREQ(2, 16)

define SANITIZER_USE_GETAUXVAL 1

#else

define SANITIZER_USE_GETAUXVAL 0

#endif

then use SANITIZER_USE_GETAUXVAL

  • Sync two ifdefs
alekseyshl marked an inline comment as done.Mar 22 2017, 12:06 PM
kcc accepted this revision.Mar 22 2017, 1:14 PM

LGTM

This revision is now accepted and ready to land.Mar 22 2017, 1:14 PM
eugenis accepted this revision.Mar 22 2017, 2:40 PM

LGTM

This revision was automatically updated to reflect the committed changes.