summaryrefslogtreecommitdiff
path: root/lib/asan/asan_flags.h
AgeCommit message (Collapse)Author
2015-02-12[Sanitizer] Change InitializeFlags() signatures. NFC.Alexey Samsonov
These functions are always used to initialize singleton flags(), as well as other global data (common_flags()). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@228894 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-15[sanitizer] Flag parser rewrite.Evgeniy Stepanov
The new parser is a lot stricter about syntax, reports unrecognized flags, and will make it easier to implemented some of the planned features. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@226169 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-07[Sanitizer] Change the runtime flag representation.Alexey Samsonov
This mirrors r225239 to all the rest sanitizers: ASan, DFSan, LSan, MSan, TSan, UBSan. Now the runtime flag type, name, default value and description is located in the single place in the .inc file. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@225327 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-22AddressSanitizer: Abort after failed exec() and get rid of the allow_reexec ↵Kuba Brecka
ASan flag As mentioned in https://code.google.com/p/address-sanitizer/issues/detail?id=365, when the re-exec that adds the required DYLD_INSERT_LIBRARIES variable fails, ASan currently continues to run, but things are broken (some memory can be overwritten, interceptors don't work, ...). This patch aborts if the execv() fails and prints an error message that DYLD_INSERT_LIBRARIES is required. It also removes the "alllow_reexec" flag, since using it causes the same issues. Reviewed at http://reviews.llvm.org/D6752 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224712 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-17[ASan] Move flag parsing logic to asan_flags.cc. NFC.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224450 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-22[ASan] Introduce the dump_instruction_bytes flag to print the faulting ↵Alexander Potapenko
instruction upon SIGSEGV When dump_instruction_bytes=1 and the instruction pointer doesn't point to the zero page, ASan prints 16 bytes starting at the instruction point. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218243 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-12[Sanitizer] Make disable_coredump a common flag and use it in TSanAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@215479 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-04[asan] introduce __asan_poison_cxx_array_cookie. This is asan-rt part of ↵Kostya Serebryany
PR19838 (Left OOB accesses on new[]-allocated arrays with array cookies are not detected). No tests yet. They will follow once I commit the clang part. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@214711 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-30[asan] rename new-delete-size-mismatch to new-delete-type-mismatch and make ↵Kostya Serebryany
the report more verbose git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@214299 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-30[asan] add a feature to detect new-delete-size-mismatch (when used with ↵Kostya Serebryany
-Xclang -fsized-deallocation). Not yet on Mac. Also, remove some unused code. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@214296 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-12[asan] Move the "coverage" flag to common flags.Sergey Matveev
The implementation lives in sanitizer_common and will need to access that flag. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@208566 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-28[asan] split detect_odr_violation into two: =2 detects all ODR violations, ↵Kostya Serebryany
=1 detects only those where the variable sizes are different. BTW, the detector seems to be working well and finding nice bugs. Early adopters are welcome. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@207415 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-25[asan] implement an experimental detector of ODR violations. Not tested yet ↵Kostya Serebryany
outside of a tiny test, may need tuning. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@207210 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-21[asan] add a run-time flag detect_container_overflow=true/falseKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@206753 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21[ASan] Move the flag descriptions from comments to ParseFlag arguments.Alexander Potapenko
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204440 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-27[asan] *experimental* implementation of invalid-pointer-pair detector (finds ↵Kostya Serebryany
when two unrelated pointers are compared or subtracted). This implementation has both false positives and false negatives and is not tuned for performance. A bug report for a proper implementation will follow. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202389 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-28[ASan] Move the signal handling-related flags to sanitizer_common.Alexander Potapenko
This change is a part of refactoring intended to have common signal handling behavior in all tools. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200295 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-16[asan] Implement delayed activation of AddressSanitizerEvgeniy Stepanov
This change adds ASAN_OPTIONS=start_deactivated=1 flag. When present, ASan will start in "deactivated" mode, with no heap poisoning, no quarantine, no stack trace gathering, and minimal redzones. All this features come back when __asan_init is called for the constructor of an instrumented library. The primary use case for this feature is Android. Code itself is not Android-specific, and this patch includes a Linux test for it. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@199377 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-09[asan] Implement max_redzone runtime flag.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@198873 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-16[asan] replace the flag uar_stack_size_log with two flags ↵Kostya Serebryany
min_uar_stack_size_log/max_uar_stack_size_log git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@197370 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-13[asan] add flag uar_noreserve to use noreserve mmap for fake stack. ↵Kostya Serebryany
uar_noreserve=1 will save some memory but also negatively affect performance git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@197233 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-15Reapply asan coverage changes 194702-194704.Bob Wilson
I still don't know what is causing our bootstrapped LTO buildbots to fail, but llvm r194701 seems to be OK and I can't imagine that these changes could cause the problem. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194790 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-15Speculatively revert asan coverage changes 194702-194704.Bob Wilson
Apple's bootstrapped LTO builds have been failing, and these changes (along with llvm 194701) are the only things on the blamelist. I will either reapply these changes or help debug the problem, depending on whether this fixes the buildbots. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194779 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-14[asan] Poor man's coverage that works with ASan (compiler-rt part)Kostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194702 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-01[ASan] Kill use_stack_depot runtime flag and stack trace compression routines.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193868 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-16[asan] introduce run-time flag 'poison_partial' Kostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192793 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-15tsan: move verbosity flag to CommonFlagsDmitry Vyukov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192701 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-27[asan] introduce run-time flag uar_stack_size_log to control the size of ↵Kostya Serebryany
FakeStack; don't crash when the fake stack is exhausted, move some code to .cc file git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191510 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-18[asan] add a run-time option detect_stack_use_after_return, add verbosity ↵Kostya Serebryany
output for fake stack git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190932 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-22[lsan] Make __lsan_do_leak_check() honor the detect_leaks flag.Sergey Matveev
Also move detect_leaks to common flags. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@186821 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-25[sanitizer] Move log_path to common flag and use it in MSan.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@184836 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-21[asan] LSan hooks in asan_rtl.Sergey Matveev
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182384 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-06[asan] Common flags in ASan.Sergey Matveev
Some flags that are common to ASan/MSan/TSan/LSan have been moved to sanitizer_common. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@181193 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-25[ASan] Add allow_user_segv_handler to let users override SEGV handler ↵Alexey Samsonov
installed by ASan git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@180255 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-19[ASan] Make init-order checker allow access to already initialized globals.Alexey Samsonov
This change adds ASan runtime option "strict-init-order" (off by default) that makes init-order checker bark if global initializer accesses any global from different translation unit (even if the latter is already initialized). strict init-order checking doesn't play well with, e.g. LLVM registration machineries, and causes issue https://code.google.com/p/address-sanitizer/issues/detail?id=178. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@179843 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11[asan] inline flags(), up to 1% perf gain on malloc-intensive codeKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@179307 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-04[asan] nuke the old unused allocator codeKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@178758 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-04[asan] fill first 4K of malloc-ed memory with garbage, implement flags ↵Kostya Serebryany
max_malloc_fill_size and malloc_fill_byte git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@178757 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-28[ASan] Add the memcmp_strict flag (1 by default) that controls the behavior ↵Alexander Potapenko
of accessibility checks in memcmp. 1: memcmp(p1, p2, n) always checks n bytes 0: memcmp checks up to n bytes depending on whether the memory contents differ. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@176256 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-19[ASan] Allow ASan default runtime options be overriden at compile time by ↵Alexey Samsonov
providing ASAN_DEFAULT_OPTIONS macro git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@175512 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-07[ASan] Remove the replace_cfallocator flag, which is used no more.Alexander Potapenko
See https://code.google.com/p/address-sanitizer/issues/detail?id=10 for the context. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@174629 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-30[sanitizer] Further split private and public sanitizer headers.Evgeniy Stepanov
And make msan_interface.h C-compatible. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@173928 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28[asan] two more internal flags for asan-rt: print_stats (0) and print_legend ↵Kostya Serebryany
(1) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@173671 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-26[asan] asan_allocator2: by default use the StackDepot to store the stack ↵Kostya Serebryany
traces instead of storing them in the redzones git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@171099 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-21[asan] add a flag alloc_dealloc_mismatch (off by default for now) which ↵Kostya Serebryany
finds malloc/delete, new/free, new/delete[], etc mismatches git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@170869 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-20[asan] add a flag poison_heap to allow better allocator benchmarking, ↵Kostya Serebryany
implemenet malloc_stats() on Linux git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@170685 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-13[asan] add two asan flags: fast_unwind_on_fatal and fast_unwind_on_malloc to ↵Kostya Serebryany
allow using the slow CFI-based unwinder git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@170117 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-14[asan] add asan option log_path=PATH to let users redirect asan reports to a ↵Kostya Serebryany
file PATH.PID instead of stderr git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@163872 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-05[ASan] Add print_full_thread_history runtime option (on by default) that ↵Alexey Samsonov
prints all full thread creation paths for threads involved in ASan error report git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@163200 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29Relocate the external headers provided by ASan and the common sanitizerChandler Carruth
library. These headers are intended to be available to user code when built with AddressSanitizer (or one of the other sanitizer's in the future) to interface with the runtime library. As such, they form stable external C interfaces, and the headers shouldn't be located within the implementation. I've pulled them out into what seem like fairly obvious locations and names, but I'm wide open to further bikeshedding of these names and locations. I've updated the code and the build system to cope with the new locations, both CMake and Makefile. Please let me know if this breaks anyone's build. The eventual goal is to install these headers along side the Clang builtin headers when we build the ASan runtime and install it. My current thinking is to locate them at: <prefix>/lib/clang/X.Y/include/sanitizer/common_interface_defs.h <prefix>/lib/clang/X.Y/include/sanitizer/asan_interface.h <prefix>/lib/clang/X.Y/include/sanitizer/... But maybe others have different suggestions? Fixing the style of the #include between these headers at least unblocks experimentation with installing them as they now should work when installed in these locations. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162822 91177308-0d34-0410-b5e6-96231b3b80d8