summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/interception/interception_win.h
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [Sanitizers] Use SANITIZER_* macros in lib/interceptionKamil Rytarowski2017-12-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Unlike the rest of the sanitizer code, lib/interception uses native macros like __linux__ to check for specific targets instead of the common ones like SANITIZER_LINUX. When working on the Solaris port of the sanitizers, the current style was found to not only be inconsistent, but clumsy to use because the canonical way to check for Solaris is to check for __sun__ && __svr4__ which is a mouthful. Therefore, this patch switches to use SANITIZER_* macros instead. Tested on x86_64-pc-linux-gnu. Reviewers: kcc, vitalybuka Reviewed By: vitalybuka Subscribers: #sanitizers, srhines, krytarowski, llvm-commits, fedor.sergeev Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D39798 llvm-svn: 319906
* [compiler-rt] Refactor the interception code on windows.Etienne Bergeron2016-07-111-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is a cleanup and refactoring of the interception code on windows Enhancement: * Adding the support for 64-bits code * Adding several hooking technique: * Detour * JumpRedirect * HotPatch * Trampoline * Adding a trampoline memory pool (64-bits) and release the allocated memory in unittests Cleanup: * Adding unittests for 64-bits hooking techniques * Enhancing the RoundUpInstruction by sharing common decoder Reviewers: rnk Subscribers: llvm-commits, wang0109, chrisha Differential Revision: http://reviews.llvm.org/D22111 llvm-svn: 275123
* [asan] Intercept all Heap* related imports from ucrtbase.dllReid Kleckner2016-03-241-0/+13
| | | | | | | | | | | | | | | | | | | | | | ucrtbase.dll appears to be built with some kind of cross-module inlining, because there are calls to imported Heap* routines sprinkled throughout the code. This inlining defeats our attempts to hotpatch malloc, _malloc_base, and related functions. Failing to intercept an allocation or deallocation results in a crash when the program attempts to deallocate or reallocate memory with the wrong allocator. This change patches the IAT of ucrtbase.dll to replace the addresses of the imported Heap* functions with implementations provided by ASan. We don't globally intercept the win32 Heap* functions because they are typically used by system DLLs that run before ASan initializes. Eventually, we may want to intercept them, but for now I think this is the minimal change that will keep ASan stable. Reviewers: samsonov Differential Revision: http://reviews.llvm.org/D18413 llvm-svn: 264327
* [windows] Implement GetProcAddress internally to avoid initializing the CRTReid Kleckner2015-08-181-0/+4
| | | | | | | | | | | | | | | | | 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
* [ASan/Win] Intercept memory allocation functions in the MD CRTTimur Iskhodzhanov2014-08-251-11/+17
| | | | llvm-svn: 216382
* [ASan/Win] Remove one more reference to ↵Timur Iskhodzhanov2014-08-151-3/+1
| | | | | | __interception::GetRealFunctionAddress (follow-up to r215707) llvm-svn: 215722
* [ASan/Win] Remove old, unused and non-functional code that will be ↵Timur Iskhodzhanov2014-08-151-2/+0
| | | | | | re-written soon llvm-svn: 215707
* Make some pthread_mutex_* and pthread_cond_* interceptors common.Alexey Samsonov2013-10-161-0/+3
| | | | | | | | | | | | Reviewers: eugenis, dvyukov Reviewed By: dvyukov CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1937 llvm-svn: 192774
* Follow-up for r161168 for WindowsAlexey Samsonov2012-08-021-5/+8
| | | | llvm-svn: 161169
* [asan] move lib/asan/interception to lib/interception so that other tools ↵Kostya Serebryany2012-05-151-0/+42
(e.g. tsan) can use it llvm-svn: 156816
OpenPOWER on IntegriCloud