Commit Graph

44 Commits

Author SHA1 Message Date
Reid Kleckner a8c44c3d0c Follow up to r283955: add _recalloc_base dll thunk
llvm-svn: 284059
2016-10-12 21:59:56 +00:00
Kostya Serebryany e923a1a486 [sanitizer-coverage] remove stale code, second attempt after failed r282994
llvm-svn: 283185
2016-10-04 04:18:30 +00:00
Etienne Bergeron c07e576968 [compiler-rt] Add support for the dynamic shadow allocation
Summary:
This patch is adding support for dynamic shadow allocation.

This is a merge and re-commit of the following patches.

```
[compiler-rt] Fix Asan build on Android
  https://reviews.llvm.org/D24768
[compiler-rt] Add support for the dynamic shadow allocation
  https://reviews.llvm.org/D23363
```

This patch needed to re-land at the same time:
```
[asan] Support dynamic shadow address instrumentation
  https://reviews.llvm.org/D23354
```

Reviewers: rnk, zaks.anna

Subscribers: tberghammer, danalbert, kubabrecka, dberris, chrisha, llvm-commits

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

llvm-svn: 282882
2016-09-30 17:47:34 +00:00
Nico Weber b097c8fa2b revert 282085, 281909, they broke 32-bit dynamic ASan and the sanitizer-windows bot
llvm-svn: 282096
2016-09-21 18:22:43 +00:00
Etienne Bergeron 130a190bf0 [compiler-rt] Add support for the dynamic shadow allocation
Summary:
This patch is adding the needed code to compiler-rt to support
dynamic shadow.

This is to support this patch:
  https://reviews.llvm.org/D23354

It's adding support for using a shadow placed at a dynamic address determined
at runtime.

The dynamic shadow is required to work on windows 64-bits.

Reviewers: rnk, kcc, vitalybuka

Subscribers: kubabrecka, dberris, llvm-commits, chrisha

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

llvm-svn: 281909
2016-09-19 15:59:01 +00:00
Kostya Serebryany f0ca160ea2 [sanitizer] rename __sanitizer_symbolize_data to __sanitizer_symbolize_global (to avoid conflict with another definition)
llvm-svn: 281902
2016-09-19 14:18:16 +00:00
Kostya Serebryany 88b93166dc [sanitizer] add __sanitizer_symbolize_data (can only print the names of the globals for now)
llvm-svn: 281886
2016-09-19 05:10:32 +00:00
Reid Kleckner 6a5c2cd2b1 Remove undefined weak hooks from dll thunk export list to really fix windows build
llvm-svn: 281747
2016-09-16 17:05:40 +00:00
Kostya Serebryany 3e9ce5f447 [asan] provide dummy implementations for __sanitizer_cov_trace_pc_*
llvm-svn: 281677
2016-09-15 23:02:20 +00:00
Anna Zaks 8cea92b972 [sanitizer] Fixup: Do not introduce __sanitizer namespace globally
Use the namespace in asan_win_dll_thunk.cc to fix the Windows bot.

llvm-svn: 281659
2016-09-15 21:15:06 +00:00
Reid Kleckner 389c7f9142 Really fix the Windows sanitizer build
Don't list __sanitizer_print_memory profile as an INTERFACE_FUNCTION. It
is not exported by ASan; it is exported by user code.

Move the weak definition from asan_win.cc to sanitizer_win.cc to fix the
ubsan tests.

llvm-svn: 281619
2016-09-15 15:39:52 +00:00
Kostya Serebryany 8d22e6c27b [asan] fix windows
llvm-svn: 281548
2016-09-14 22:13:20 +00:00
Reid Kleckner 507ba20907 Fix dll_host.cc test after adding div and gep trace coverage points
llvm-svn: 280387
2016-09-01 18:08:05 +00:00
Vitaly Buka ac644fa917 [asan] Remove runtime flag detect_stack_use_after_scope
Summary:
We are going to use store instructions to poison some allocas.
Runtime flag will require branching in instrumented code on every lifetime
intrinsic. We'd like to avoid that.

Reviewers: eugenis

Subscribers: llvm-commits, kubabrecka

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

llvm-svn: 279981
2016-08-29 17:16:59 +00:00
Kostya Serebryany 66b2ac0ee4 [asan] fix windows bot
llvm-svn: 279781
2016-08-25 21:45:18 +00:00
Kostya Serebryany 68f8cbd597 [asan] trying to fix the windows bot
llvm-svn: 279030
2016-08-18 02:04:03 +00:00
Vitaly Buka 1396b9f072 [asan] Add __asan_set_shadow_*
Summary:
We are poisoning small allocas using store instruction from instrumented code.
For larger allocas we'd like to insert function calls instead of multiple stores.

PR27453

Reviewers: kcc, eugenis

Subscribers: llvm-commits, kubabrecka

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

llvm-svn: 279019
2016-08-18 00:56:11 +00:00
Mike Aizatsky 04897dcc3d [sanitizers] trace buffer API to use user-allocated buffer.
Subscribers: kubabrecka

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

llvm-svn: 277858
2016-08-05 20:09:42 +00:00
Etienne Bergeron 502df06e21 [compiler-rt] Fix various typos in asan dll [NFC]
llvm-svn: 277345
2016-08-01 15:08:12 +00:00
Vitaly Buka 9f9c089fe2 Add detect_stack_use_after_scope runtime flag
Summary: This flag could be used to disable check in runtime.

Subscribers: kubabrecka

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

llvm-svn: 276004
2016-07-19 18:11:08 +00:00
Etienne Bergeron 9da82d6aca [compiler-rt] Fix 64-bits exception handlers in ASAN 64-bits runtime
Summary:
This is adding the appropriate suport for exception handling for
64-bits ASAN on windows.

Reviewers: rnk

Subscribers: kubabrecka, llvm-commits, wang0109, chrisha

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

llvm-svn: 275585
2016-07-15 17:28:10 +00:00
Etienne Bergeron c52ae0e8d1 [asan] Avoid hooking memchr() on Windows64
There is not enough padding in front of memchr(), and, the first 6 bytes
contains a branch instruction. Basically the current interception will
not work on memchr().

It was disabled before, but was missing the part to disable it for
INTERCEPT_LIBRARY_FUNCTION.

Patch by Wei Wang

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

llvm-svn: 275494
2016-07-14 22:29:22 +00:00
Dmitry Vyukov 42c06a933a Fix asan_win_dll_thunk.cc test
Add the two public functions I added in my last commit in asan_win_dll_thunk.cc

Author: blastrock (Philippe Daouadi)
Reviewed in http://reviews.llvm.org/D21557

llvm-svn: 273288
2016-06-21 17:28:06 +00:00
Kostya Serebryany bf6a04fde8 [sanitizers] introduce yet another API function: __sanitizer_install_malloc_and_free_hooks
llvm-svn: 272943
2016-06-16 20:06:06 +00:00
Benjamin Kramer 1539cd326e Update asan_win_dll_thunk.cc to fix the windows buildbot.
llvm-svn: 271203
2016-05-30 10:00:54 +00:00
Reid Kleckner 23d0fde535 [asan] Intercept strdup on Windows
Some unit tests were failing because we didn't intercept strdup.  It
turns out it works just fine on 2013 and 2015 with a small patch to the
interception logic.

llvm-svn: 264013
2016-03-22 00:52:47 +00:00
Reid Kleckner ed051774ba [asan] Add new _*_base interceptors for VS 2015
There are some places in the CRT (such as mbctype) that directly call
_malloc_base. If you are incrementally linking a binary with ASan from
before this change, this change appears to result in a linker error.
Retrying the link succeeds for some reason.

llvm-svn: 264005
2016-03-21 23:51:17 +00:00
Evgeniy Stepanov 7923ce692e [asan] Add strrchr to asan_win_dll_thunk.
"dll_host.cc" test says there is a mismatch.

llvm-svn: 263998
2016-03-21 22:42:15 +00:00
Mike Aizatsky cc56ac3669 [sancov] adding internal function
llvm-svn: 256806
2016-01-05 02:09:54 +00:00
Alexander Potapenko 00bddf6406 [ASan] Fix the links to bugs and wikipages.
llvm-svn: 254735
2015-12-04 17:37:40 +00:00
Reid Kleckner 99f23473a1 [Windows] Add exports for dll_host test broken by r252071 and r251071
llvm-svn: 252784
2015-11-11 19:34:01 +00:00
Alexey Samsonov edf18d20a0 [ASan] Add two new functions to DLL thunk.
llvm-svn: 252359
2015-11-06 23:04:00 +00:00
Reid Kleckner d85f7010cc [windows] Implement GetProcAddress internally to avoid initializing the CRT
ASan uses GetProcAddress to get the address of malloc so it can patch
it. Newer versions of Windows make GetProcAddress initialize the DLL
before returning a function pointer into it. That's perfectly
reasonable, but ASan needs to finish patching malloc before CRT
initialization. So now we roll our own GetProcAddress.

Fixes PR24237

Based on a patch by David Major

Originally written by David Major as part of:
https://hg.mozilla.org/mozilla-central/file/tip/toolkit/xre/WindowsCrtPatch.h

llvm-svn: 245377
2015-08-18 22:38:27 +00:00
Kostya Serebryany 4fca6e8063 [libFuzzer] prepare for __sanitizer_cov_trace_switch in libFuzzer and sanitizer coverage. Also fix pedantic warnings
llvm-svn: 243721
2015-07-31 01:07:12 +00:00
Kuba Brecka 94da66a92f [asan] Trying to make peace with the Windows bots, take 2
There are some test failures after r243003 and r243004 ("Rename the ABI
versioning symbol to '__asan_version_mismatch_check' instead abusing
'__asan_init'"). See http://reviews.llvm.org/D11004

llvm-svn: 243007
2015-07-23 11:53:58 +00:00
Kuba Brecka 0caef4c8d6 [asan] Trying to make peace with the Windows bots
There are some test failures after r243003 and r243004 ("Rename the ABI
versioning symbol to '__asan_version_mismatch_check' instead abusing
'__asan_init'"). See http://reviews.llvm.org/D11004

llvm-svn: 243005
2015-07-23 11:20:14 +00:00
Kuba Brecka a11cfb990a [asan] Rename the ABI versioning symbol to '__asan_version_mismatch_check' instead of abusing '__asan_init'
We currently version `__asan_init` and when the ABI version doesn't match, the linker gives a `undefined reference to '__asan_init_v5'` message. From this, it might not be obvious that it's actually a version mismatch error. This patch makes the error message much clearer by changing the name of the undefined symbol to be `__asan_version_mismatch_check_xxx` (followed by the version string). We obviously don't want the initializer to be named like that, so it's a separate symbol that is used only for the purpose of version checking.

Reviewed at http://reviews.llvm.org/D11004

llvm-svn: 243004
2015-07-23 10:55:13 +00:00
Yury Gribov 73570f4323 [ASan] Add new interceptors to asan_win_dll_thunk.cc to fix build errors on Windows.
Patch by Maria Guseva!

llvm-svn: 238407
2015-05-28 10:21:59 +00:00
Reid Kleckner 1cdd948f5b [ASan/Win] Add DLL thunk for new coverage hook
Should fix dll_host.cc test failing on bots.

llvm-svn: 237725
2015-05-19 21:02:23 +00:00
Kostya Serebryany 92b8ab502c [asan] attempting to fix the windows build
llvm-svn: 231171
2015-03-03 23:38:24 +00:00
Timur Iskhodzhanov 6ba66b95d1 [ASan/Win] Add support for sanitizer allocator hooks, __asan_default_options and __asan_on_error
llvm-svn: 230344
2015-02-24 17:07:22 +00:00
Timur Iskhodzhanov 2462a2f404 [ASan/Win] Thread sanitizer common interface through asan_win_dll_thunk.cc
llvm-svn: 229860
2015-02-19 15:25:26 +00:00
Evgeniy Stepanov 7555f5ed1f [msan] Remove MSanDR and supporting code.
MSanDR is a dynamic instrumentation tool that can instrument the code
(prebuilt libraries and such) that could not be instrumented at compile time.

This code is unused (to the best of our knowledge) and unmaintained, and
starting to bit-rot.

llvm-svn: 222232
2014-11-18 10:33:15 +00:00
Timur Iskhodzhanov 81885731a8 [ASan/Win] Rename asan_dll_thunk.cc to asan_win_dll_thunk.cc
llvm-svn: 216448
2014-08-26 10:21:37 +00:00