Bypass potential libc's sysconf interceptors
authorAlex Shlyapnikov <alekseys@google.com>
Thu, 23 Mar 2017 15:57:58 +0000 (15:57 +0000)
committerAlex Shlyapnikov <alekseys@google.com>
Thu, 23 Mar 2017 15:57:58 +0000 (15:57 +0000)
commit86abf9aeb3138dcee9d2c110a911dbe8108fdd62
treec1c3ed9fd91e5e2e6a07ed3b9e0f56a81c7040b9
parent9a4e45a0ed1473caad64f4b7b8299e011d1458a8
Bypass potential libc's sysconf interceptors

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).

Reviewers: eugenis

Subscribers: kubamracek, llvm-commits

Differential Revision: https://reviews.llvm.org/D31221

llvm-svn: 298613
compiler-rt/lib/sanitizer_common/sanitizer_linux.cc
compiler-rt/test/sanitizer_common/TestCases/Linux/sysconf_interceptor_bypass_test.cc [new file with mode: 0644]