Commit Graph

458 Commits

Author SHA1 Message Date
Adrian Prantl
3051c6d512 ASAN: Don't drop debug info attachements for global variables.
This is a follow-up to r281284. Global Variables now can have
!dbg attachements, so ASAN should clone these when generating a
sanitized copy of a global variable.

<rdar://problem/24899262>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281994 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 18:28:42 +00:00
Kostya Serebryany
18f63e47d8 [sanitizer-coverage] add comdat to coverage guards if needed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281952 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 00:16:54 +00:00
Etienne Bergeron
b87b0d3795 [asan] Support dynamic shadow address instrumentation
Summary:
This patch is adding the support for a shadow memory with
dynamically allocated address range.

The compiler-rt needs to export a symbol containing the shadow
memory range.

This is required to support ASAN on windows 64-bits.

Reviewers: kcc, rnk, vitalybuka

Subscribers: kubabrecka, dberris, llvm-commits, chrisha

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281908 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 15:58:38 +00:00
Kostya Serebryany
16197d80b6 [sanitizer-coverage] change trace-pc to use 8-byte guards
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281809 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-17 05:03:05 +00:00
Vitaly Buka
d26bf22afc Revert "[asan] Avoid lifetime analysis for allocas with can be in ambiguous state"
This approach is not good enough. Working on the new solution.

This reverts commit r280907.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281689 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 01:38:46 +00:00
Vitaly Buka
1354d58f56 Revert "[asan] Add flag to allow lifetime analysis of problematic allocas"
This approach is not good enough. Working on the new solution.

This reverts commit r281126.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281688 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 01:38:43 +00:00
Kostya Serebryany
31daa34b7b [sanitizer-coverage] make trace-pc-guard and indirect-call work together
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281665 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 22:11:08 +00:00
Etienne Bergeron
28f64ff6ba address comments from: https://reviews.llvm.org/D24566
using startswith instead of find.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281617 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 15:19:19 +00:00
Etienne Bergeron
24624732a0 [compiler-rt] Avoid instrumenting sanitizer functions
Summary:
Function __asan_default_options is called by __asan_init before the
shadow memory got initialized. Instrumenting that function may lead
to flaky execution.

As the __asan_default_options is provided by users, we cannot expect
them to add the appropriate function atttributes to avoid
instrumentation.

Reviewers: kcc, rnk

Subscribers: dberris, chrisha, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281503 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 17:18:37 +00:00
Kostya Serebryany
8ea4234809 [sanitizer-coverage] add yet another flavour of coverage instrumentation: trace-pc-guard. The intent is to eventually replace all of {bool coverage, 8bit-counters, trace-pc} with just this one. LLVM part
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281431 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 01:39:35 +00:00
Vitaly Buka
c4644d2241 [asan] Add flag to allow lifetime analysis of problematic allocas
Summary:
Could be useful for comparison when we suspect that alloca was skipped
because of this.

Reviewers: eugenis

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281126 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-10 01:06:11 +00:00
Dehao Chen
961ef79d43 Do not widen load for different variable in GVN.
Summary:
Widening load in GVN is too early because it will block other optimizations like PRE, LICM.

https://llvm.org/bugs/show_bug.cgi?id=29110

The SPECCPU2006 benchmark impact of this patch:

Reference: o2_nopatch
(1): o2_patched

           Benchmark             Base:Reference   (1)  
-------------------------------------------------------
spec/2006/fp/C++/444.namd                  25.2  -0.08%
spec/2006/fp/C++/447.dealII               45.92  +1.05%
spec/2006/fp/C++/450.soplex                41.7  -0.26%
spec/2006/fp/C++/453.povray               35.65  +1.68%
spec/2006/fp/C/433.milc                   23.79  +0.42%
spec/2006/fp/C/470.lbm                    41.88  -1.12%
spec/2006/fp/C/482.sphinx3                47.94  +1.67%
spec/2006/int/C++/471.omnetpp             22.46  -0.36%
spec/2006/int/C++/473.astar               21.19  +0.24%
spec/2006/int/C++/483.xalancbmk           36.09  -0.11%
spec/2006/int/C/400.perlbench             33.28  +1.35%
spec/2006/int/C/401.bzip2                 22.76  -0.04%
spec/2006/int/C/403.gcc                   32.36  +0.12%
spec/2006/int/C/429.mcf                   41.04  -0.41%
spec/2006/int/C/445.gobmk                 26.94  +0.04%
spec/2006/int/C/456.hmmer                  24.5  -0.20%
spec/2006/int/C/458.sjeng                    28  -0.46%
spec/2006/int/C/462.libquantum            55.25  +0.27%
spec/2006/int/C/464.h264ref               45.87  +0.72%

geometric mean                                   +0.23%

For most benchmarks, it's a wash, but we do see stable improvements on some benchmarks, e.g. 447,453,482,400.

Reviewers: davidxl, hfinkel, dberlin, sanjoy, reames

Subscribers: gberry, junbuml

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281074 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 18:42:35 +00:00
Vitaly Buka
52bc7ab5ec [asan] Avoid lifetime analysis for allocas with can be in ambiguous state
Summary:
C allows to jump over variables declaration so lifetime.start can be
avoid before variable usage. To avoid false-positives on such rare cases
we detect them and remove from lifetime analysis.

PR27453
PR28267

Reviewers: eugenis

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280907 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 06:27:58 +00:00
Vitaly Buka
f555e2686a Revert "[asan] Avoid lifetime analysis for allocas with can be in ambiguous state"
Fails on Windows.

This reverts commit r280880.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280883 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-07 23:37:15 +00:00
Vitaly Buka
f8002f1611 [asan] Avoid lifetime analysis for allocas with can be in ambiguous state
Summary:
C allows to jump over variables declaration so lifetime.start can be
avoid before variable usage. To avoid false-positives on such rare cases
we detect them and remove from lifetime analysis.

PR27453
PR28267

Reviewers: eugenis

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280880 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-07 23:18:23 +00:00
Kostya Serebryany
8c23b334cd [sanitizer-coverage] add two more modes of instrumentation: trace-div and trace-gep, mostly usaful for value-profile-based fuzzing; llvm part
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280043 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-30 01:12:10 +00:00
Vitaly Buka
6e3f5dd44f [asan] Enable new stack poisoning with store instruction by default
Reviewers: eugenis

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279993 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-29 19:28:34 +00:00
Vitaly Buka
b8ae70f140 Use store operation to poison allocas for lifetime analysis.
Summary:
Calling __asan_poison_stack_memory and __asan_unpoison_stack_memory for small
variables is too expensive.

Code is disabled by default and can be enabled by -asan-experimental-poisoning.

PR27453

Reviewers: eugenis

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279984 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-29 18:17:21 +00:00
Vitaly Buka
49a5f5ed32 [asan] Minimize code size by using __asan_set_shadow_* for large blocks
Summary:
We can insert function call instead of multiple store operation.
Current default is blocks larger than 64 bytes.
Changes are hidden behind -asan-experimental-poisoning flag.

PR27453

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279383 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-20 20:23:50 +00:00
Vitaly Buka
d66cc578a7 [asan] Initialize __asan_set_shadow_* callbacks
Summary:
Callbacks are not being used yet.

PR27453

Reviewers: kcc, eugenis

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279380 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-20 18:34:39 +00:00
Vitaly Buka
7b2eb8e4d0 [asan] Optimize store size in FunctionStackPoisoner::poisonRedZones
Summary: Reduce store size to avoid leading and trailing zeros.

Reviewers: kcc, eugenis

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279379 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-20 18:34:36 +00:00
Vitaly Buka
c662b7eae3 [asan] Cleanup instrumentation of dynamic allocas
Summary:
Extract instrumenting dynamic allocas into separate method.
Rename asan-instrument-allocas -> asan-instrument-dynamic-allocas

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279376 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-20 17:22:27 +00:00
Vitaly Buka
31c625e355 Revert "[asan] Optimize store size in FunctionStackPoisoner::poisonRedZones"
This reverts commit r279178.

Speculative revert in hope to fix asan crash on arm.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279277 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-19 17:15:38 +00:00
Vitaly Buka
588e241acb Revert "[asan] Fix size of shadow incorrectly calculated in r279178"
This reverts commit r279222.

Speculative revert in hope to fix asan crash on arm.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279276 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-19 17:15:33 +00:00
Vitaly Buka
bc8fdf73ab [asan] Fix size of shadow incorrectly calculated in r279178
Summary: r279178 generates 8 times more stores than necessary.

Reviewers: eugenis

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279222 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-19 08:33:53 +00:00
Vitaly Buka
0c6c3b22db [asan] Optimize store size in FunctionStackPoisoner::poisonRedZones
Summary: Reduce store size to avoid leading and trailing zeros.

Reviewers: kcc, eugenis

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279178 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-18 23:51:15 +00:00
Vitaly Buka
3f7f855997 [asan] Extend test
Summary: PR27453

Reviewers: eugenis

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279109 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-18 18:17:19 +00:00
Kostya Serebryany
aa4e23e1bb [sanitizer-coverage/libFuzzer] instrument comparisons with __sanitizer_cov_trace_cmp[1248] instead of __sanitizer_cov_trace_cmp, don't pass the comparison type to save a bit performance. Use these new callbacks in libFuzzer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279027 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-18 01:25:28 +00:00
Vitaly Buka
fc819213c1 [Asan] Unpoison red zones even if use-after-scope was disabled with runtime flag
Summary: PR27453

Reviewers: eugenis

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278818 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 16:24:10 +00:00
Vitaly Buka
ecefac9053 Unpoison stack before resume instruction
Summary:
Clang inserts cleanup code before resume similar way as before return instruction.
This makes asan poison local variables causing false use-after-scope reports.

__asan_handle_no_return does not help here as it was executed before
llvm.lifetime.end inserted into resume block.

To avoid false report we need to unpoison stack for resume same way as for return.

PR27453

Reviewers: kcc, eugenis

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276480 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 22:04:38 +00:00
Vitaly Buka
cb5c574105 Fix detection of stack-use-after scope for char arrays.
Summary:
Clang inserts GetElementPtrInst so findAllocaForValue was not
able to find allocas.

PR27453

Reviewers: kcc, eugenis

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276374 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 00:56:17 +00:00
Vedant Kumar
ea47fc5fc9 [tsan] Don't instrument __llvm_gcov_global_state_pred or __llvm_gcda*
r274801 did not go far enough to allow gcov+tsan to cooperate. With this
commit it's possible to run the following code without false positives:

  std::thread T1(fib), T2(fib);
  T1.join(); T2.join();

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276015 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 20:16:08 +00:00
Kostya Serebryany
ec8a2f2059 [sanitizer-coverage] make sure that calls to __sanitizer_cov_trace_pc are not merged (otherwise different calls get the same PC and confuse fuzzers)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275449 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 17:59:01 +00:00
Vedant Kumar
a161bdd9f5 [tsan] Try harder to not instrument gcov counters
GCOVProfiler::emitProfileArcs() can create many variables with names
starting with "__llvm_gcov_ctr", so llvm appends a numeric suffix to
most of them. Teach tsan about this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274801 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-07 22:45:28 +00:00
Qin Zhao
2bbac40f4b [esan:cfrag] Add option -esan-aux-field-info
Summary:
Adds option -esan-aux-field-info to control generating binary with
auxiliary struct field information.

Extracts code for creating auxiliary information from
createCacheFragInfoGV into createCacheFragAuxGV.

Adds test struct_field_small.ll for -esan-aux-field-info test.

Reviewers: aizatsky

Subscribers: llvm-commits, bruening, eugenis, kcc, zhaoqin, vitalybuka

Differential Revision: http://reviews.llvm.org/D22019

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274726 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-07 03:20:16 +00:00
Derek Bruening
1a6ed75eac [esan|wset] Fix incorrect memory size assert
Summary:
Fixes an incorrect assert that fails on 128-bit-sized loads or stores.
Augments the wset tests to include this case.

Reviewers: aizatsky

Subscribers: vitalybuka, zhaoqin, kcc, eugenis, llvm-commits

Differential Revision: http://reviews.llvm.org/D22062

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274666 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-06 20:13:53 +00:00
Ryan Govostes
4205e17d8c [asan] Add a hidden option for Mach-O global metadata liveness tracking
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274578 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-05 21:53:08 +00:00
Qin Zhao
bafbf2b643 [esan|cfrag] Add counters for struct array accesses
Summary:
Adds one counter to the struct counter array for counting struct
array accesses.

Adds instrumentation to insert counter update for struct array
accesses.

Reviewers: aizatsky

Subscribers: llvm-commits, bruening, eugenis, kcc, zhaoqin, vitalybuka

Differential Revision: http://reviews.llvm.org/D21594

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274420 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-02 03:25:37 +00:00
Evgeniy Stepanov
dcfa1b5241 [msan] Fix __msan_maybe_ for non-standard type sizes.
Fix incorrect calculation of the type size for __msan_maybe_warning_N
call that resulted in an invalid (narrowing) zext instruction and
"Assertion `castIsValid(op, S, Ty) && "Invalid cast!"' failed."

Only happens in very large functions (with more than 3500 MSan
checks) operating on integer types that are not power-of-two.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274395 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-01 22:49:59 +00:00
Vedant Kumar
f317b6e2b1 [asan] Do not instrument accesses to profiling globals
It's only useful to asan-itize profiling globals while debugging llvm's
profiling instrumentation passes. Enabling asan along with instrprof or
gcov instrumentation shouldn't incur extra overhead.

This patch is in the same spirit as r264805 and r273202, which disabled
tsan instrumentation of instrprof/gcov globals.

Differential Revision: http://reviews.llvm.org/D21541

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273444 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 17:30:58 +00:00
Anna Zaks
b523d2b232 [asan] Do not instrument pointers with address space attributes
Do not instrument pointers with address space attributes since we cannot track
them anyway. Instrumenting them results in false positives in ASan and a
compiler crash in TSan. (The compiler should not crash in any case, but that's
a different problem.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273339 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 00:15:52 +00:00
Vedant Kumar
bdba755f85 [tsan] Do not instrument accesses to the gcov counters array
There is a known intended race here. This is a follow-up to r264805,
which disabled tsan instrumentation for updates to instrprof counters.
For more background on this please see the discussion in D18164.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273202 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-20 21:24:26 +00:00
Marcin Koscielnicki
ccb3bb979e [sanitizers] Disable target-specific lowering of string functions.
CodeGen has hooks that allow targets to emit specialized code instead
of calls to memcmp, memchr, strcpy, stpcpy, strcmp, strlen, strnlen.
When ASan/MSan/TSan/ESan is in use, this sidesteps its interceptors, resulting
in uninstrumented memory accesses.  To avoid that, make these sanitizers
mark the calls as nobuiltin.

Differential Revision: http://reviews.llvm.org/D19781

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273083 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-18 10:10:37 +00:00
Qin Zhao
4e01f2cc2f [esan|cfrag] Add the struct field size array in StructInfo
Summary:
Adds the struct field size array in struct StructInfo.

Updates test struct_field_count_basic.ll.

Reviewers: aizatsky

Subscribers: vitalybuka, zhaoqin, kcc, eugenis, bruening, llvm-commits

Differential Revision: http://reviews.llvm.org/D21341

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272989 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-17 04:50:20 +00:00
Qin Zhao
bf931638c0 [esan|cfrag] Handle complex GEP instr in the cfrag tool
Summary:
Iterates all (except the first and the last) operands within each GEP
instruction for instrumentation.

Adds test struct_field_gep.ll.

Reviewers: aizatsky

Subscribers: vitalybuka, zhaoqin, kcc, eugenis, bruening, llvm-commits

Differential Revision: http://reviews.llvm.org/D21242

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272442 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-10 22:28:55 +00:00
Qin Zhao
6eba425a2f [esan|cfrag] Add the struct field offset array in StructInfo
Summary:
Adds the struct field offset array in struct StructInfo.

Updates test struct_field_count_basic.ll.

Reviewers: aizatsky

Subscribers: llvm-commits, bruening, eugenis, kcc, zhaoqin, vitalybuka

Differential Revision: http://reviews.llvm.org/D21192

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272362 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-10 02:10:06 +00:00
Qin Zhao
01724b2e65 [esan|cfrag] Disable load/store instrumentation for cfrag
Summary:
Adds ClInstrumentFastpath option to control fastpath instrumentation.

Avoids the load/store instrumentation for the cache fragmentation tool.

Renames cache_frag_basic.ll to working_set_slow.ll for slowpath
instrumentation test.

Adds the __esan_init check in struct_field_count_basic.ll.

Reviewers: aizatsky

Subscribers: llvm-commits, bruening, eugenis, kcc, zhaoqin, vitalybuka

Differential Revision: http://reviews.llvm.org/D21079

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272355 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-10 00:48:53 +00:00
Vitaly Buka
e330b7d89a Make sure that not interesting allocas are not instrumented.
Summary:
We failed to unpoison uninteresting allocas on return as unpoisoning is part of
main instrumentation which skips such allocas.

Added check -asan-instrument-allocas for dynamic allocas. If instrumentation of
dynamic allocas is disabled it will not will not be unpoisoned.

PR27453

Reviewers: kcc, eugenis

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D21207

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272341 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 23:31:59 +00:00
Vitaly Buka
af4c28d141 Unpoison stack memory in use-after-return + use-after-scope mode
Summary:
We still want to unpoison full stack even in use-after-return as it can be disabled at runtime.

PR27453

Reviewers: eugenis, kcc

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D21202

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272334 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 23:05:35 +00:00
Derek Bruening
9dfccd2eeb [esan|wset] Optionally assume intra-cache-line accesses
Summary:
Adds an option -esan-assume-intra-cache-line which causes esan to assume
that a single memory access touches just one cache line, even if it is not
aligned, for better performance at a potential accuracy cost.  Experiments
show that the performance difference can be 2x or more, and accuracy loss
is typically negligible, so we turn this on by default.  This currently
applies just to the working set tool.

Reviewers: aizatsky

Subscribers: vitalybuka, zhaoqin, kcc, eugenis, llvm-commits

Differential Revision: http://reviews.llvm.org/D20978

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271743 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-03 22:29:52 +00:00