summaryrefslogtreecommitdiff
path: root/lib/esan
AgeCommit message (Collapse)Author
2016-05-20[esan] Add custom flag supportDerek Bruening
Summary: Adds custom flag support to EfficiencySanitizer's runtime library. Adds an initial flag cache_line_size which will be used by multiple tools. Reviewers: aizatsky, vitalybuka Subscribers: llvm-commits, eugenis, kcc, zhaoqin, aizatsky, kubabrecka Differential Revision: http://reviews.llvm.org/D20478 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@270256 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20[esan] Extend shadow mapping to cover low librariesDerek Bruening
Summary: Adds support for app libraries starting slightly below 0x7f00'00000000 (the mmap ASLR range extends down to 0x7efb'f8000000 for reasonable stack limits) by switching to a shadow mapping offset of 0x1300'00000000. Reviewers: aizatsky Subscribers: vitalybuka, zhaoqin, kcc, eugenis, llvm-commits, kubabrecka Differential Revision: http://reviews.llvm.org/D20479 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@270255 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17[esan] Fix isShadowMem endpoint bugDerek Bruening
Fixes a bug in checking the endpoint of a shadow region and removes an invalid check (both introduced in http://reviews.llvm.org/rL269198). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@269834 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-11[sanitizer] Move *stat to the common interceptorsEvgeniy Stepanov
Adds *stat to the common interceptors. Removes the now-duplicate *stat interceptor from msan/tsan/esan. This adds *stat to asan, which previously did not intercept it. Patch by Qin Zhao. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@269223 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-11[esan] EfficiencySanitizer shadow memoryDerek Bruening
Summary: Adds shadow memory mapping support common to all tools to the new Efficiencysanitizer ("esan") family of tools. This includes: + Shadow memory layout and mapping support for 64-bit Linux for any power-of-2 scale-down (1x, 2x, 4x, 8x, 16x, etc.) that ensures that shadow(shadow(address)) does not overlap shadow or application memory. + Mmap interception to ensure the application does not map on top of our shadow memory. + Init-time sanity checks for shadow regions. + A test of the mmap conflict mechanism. Reviewers: aizatsky, filcab Subscribers: filcab, kubabrecka, llvm-commits, vitalybuka, eugenis, kcc, zhaoqin Differential Revision: http://reviews.llvm.org/D19921 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@269198 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03[sanitizer] Move stat/__xstat to the common interceptorsMike Aizatsky
Summary: Adds stat/__xstat to the common interceptors. Removes the now-duplicate stat/__xstat interceptor from msan/tsan/esan. This adds stat/__xstat to asan, which previously did not intercept it. Resubmit of http://reviews.llvm.org/D19875 with win build fixes. Reviewers: aizatsky, eugenis Subscribers: tberghammer, llvm-commits, danalbert, vitalybuka, bruening, srhines, kubabrecka, kcc Differential Revision: http://reviews.llvm.org/D19890 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@268466 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03Revert "[sanitizer] Move stat/__xstat to the common interceptors"Mike Aizatsky
This reverts commit 268440 because it breaks the windows bot. http://lab.llvm.org:8011/builders/sanitizer-windows/builds/21425/steps/build%20compiler-rt/logs/stdio git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@268448 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03[sanitizer] Move stat/__xstat to the common interceptorsMike Aizatsky
Summary: Adds stat/__xstat to the common interceptors. Removes the now-duplicate stat/__xstat interceptor from msan/tsan/esan. This adds stat/__xstat to asan, which previously did not intercept it. Reviewers: aizatsky, eugenis Subscribers: tberghammer, danalbert, srhines, kubabrecka, llvm-commits, vitalybuka, eugenis, kcc, bruening Differential Revision: http://reviews.llvm.org/D19875 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@268440 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03[esan] Use do-while rather than braces for empty interceptorsDerek Bruening
Summary: Replaces {} with a do..while sequence in esan's empty interceptors to allow natural use with a trailing semicolon. The sequence uses each argument to avoid warnings. Reviewers: filcab Subscribers: kubabrecka, llvm-commits, zhaoqin Differential Revision: http://reviews.llvm.org/D19832 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@268426 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27[sanitizers] Get the proper symbol version when long double transition is ↵Marcin Koscielnicki
involved. On linux, some architectures had an ABI transition from 64-bit long double (ie. same as double) to 128-bit long double. On those, glibc symbols involving long doubles come in two versions, and we need to pass the correct one to dlvsym when intercepting them. A few more functions we intercept are also versioned (all printf, scanf, strtold variants), but there's no need to fix these, as the REAL() versions are never called. Differential Revision: http://reviews.llvm.org/D19555 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267794 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25[esan] Fix uninitialized warning from interception contextDerek Bruening
The interception context is not used by esan, but the compiler complains about it being uninitialized all the same. We set it to null to avoid the warning. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267376 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-23[esan] EfficiencySanitizer libc interceptorsDerek Bruening
Summary: Adds libc interceptors to the runtime library for the new EfficiencySanitizer ("esan") family of tools. The interceptors cover the memory operations in most common library calls and will be shared among all esan tools. Reviewers: aizatsky Subscribers: zhaoqin, tberghammer, danalbert, srhines, llvm-commits, vitalybuka, eugenis, kcc Differential Revision: http://reviews.llvm.org/D19411 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267293 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21[esan] EfficiencySanitizer base runtime libraryDerek Bruening
Summary: Adds the initial version of a runtime library for the new EfficiencySanitizer ("esan") family of tools. The library includes: + Slowpath code via callouts from the compiler instrumentation for each memory access. + Registration of atexit() to call finalization code. + Runtime option flags controlled by the environment variable ESAN_OPTIONS. The common sanitizer flags are supported such as verbosity and log_path. + An initial simple test. Still TODO: common code for libc interceptors and shadow memory mapping, and tool-specific code for shadow state updating. Reviewers: eugenis, vitalybuka, aizatsky, filcab Subscribers: filcab, vkalintiris, kubabrecka, llvm-commits, zhaoqin, kcc Differential Revision: http://reviews.llvm.org/D19168 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267060 91177308-0d34-0410-b5e6-96231b3b80d8