summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/interception/tests/interception_win_test.cc
Commit message (Collapse)AuthorAgeFilesLines
* compiler-rt: Rename .cc file in lib/{interception/tests,safestack} to .cppNico Weber2019-08-011-657/+0
| | | | | | Like r367463, but for interception/tests and safestack. llvm-svn: 367560
* Commit macro intended to be included in r353483.Reid Kleckner2019-02-071-1/+1
| | | | llvm-svn: 353484
* [compiler rt] Win64 GetInstructionSize additional register MOV + stack ↵Reid Kleckner2019-02-071-2/+23
| | | | | | | | | | | | | | | | | | | | | | | alignment AND Current interception code does not cover all of the required registers on Windows for a specific flavor of MOV, so this patch adds cases to identify the following 5-byte instructions on 64-bit Windows: mov QWORD PTR [rsp + XX], rdx <- second integer argument mov QWORD PTR [rsp + XX], r9 <- third integer argument mov QWORD PTR [rsp + XX], r8 <- fourth integer argument The instruction for MOV [...] RCX is already covered in the previous version. Patch by Matthew McGovern! Reviewers: rnk Differential Revision: https://reviews.llvm.org/D57339 llvm-svn: 353483
* 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
* [WinASan] Fix hotpatching new Win 10 build 1703 x64 strnlen prologueReid Kleckner2017-06-161-0/+11
| | | | | | | | | | | The first instruction of the new ucrtbase!strnlen implementation loads a global, presumably to dispatch between SSE and non-SSE optimized strnlen implementations. Fixes PR32895 and probably https://github.com/google/sanitizers/issues/818 llvm-svn: 305581
* [interception] Check for export table's size before referring to its elements.Marcos Pividori2017-01-301-0/+7
| | | | | | | | | | | | This fix a bug, when calling InternalGetProcAddress() for an executable that doesn't export any symbol. So the table is empty. If we don't check for this condition, the program fails with Error 0xc0000142. Also, I add a regression test for Windows. Differential Revision: https://reviews.llvm.org/D28502 llvm-svn: 293521
* [asan] Don't assert that a target is within 2GB on 32-bit WindowsReid Kleckner2016-11-151-6/+25
| | | | | | | | | | | | | | | | Summary: In a 32-bit address space, PC-relative jump targets are wrapped, so a direct branch at 0x90000001 can reach address 0x10000000 with a displacement of 0x7FFFFFFFF. This can happen in applications, such as Chrome, that are linked with /LARGEADDRESSAWARE. Reviewers: etienneb Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D26650 llvm-svn: 286997
* [compilter-rt] Try to fix correctly rL277560Etienne Bergeron2016-08-031-4/+0
| | | | | rL277560: [compiler-rt] Fix broken interception unittest llvm-svn: 277567
* [compiler-rt] Fix broken interception unittestEtienne Bergeron2016-08-031-0/+4
| | | | | | | | | | | | | | | | | | | Summary: This patch is fixing a broken unittest which make the win64 bot failing. The bug was introduce here: https://reviews.llvm.org/D23046 The interception code is not the same in 32-bit and in 64-bit. The added unittest can only be patched on 32-bits. Reviewers: rnk Subscribers: llvm-commits, chrisha Differential Revision: https://reviews.llvm.org/D23099 llvm-svn: 277560
* [asan] Intercept RtlRaiseException instead of kernel32!RaiseExceptionReid Kleckner2016-08-021-0/+8
| | | | | | | | | | | | | | | | | | | | Summary: On my install of Windows 10, RaiseException is a tail call to kernelbase!RaiseException. Obviously, we fail to intercept that. Instead, try hooking at the ntdll!RtlRaiseException layer. It is unlikely that this layer will contain control flow. Intercepting at this level requires adding a decoding for 'LEA ESP, [ESP + 0xXXXXXXXX]', which is a really obscure way to write 'SUB ESP, 0xXXXXXXXX' that avoids clobbering EFLAGS. Reviewers: etienneb Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D23046 llvm-svn: 277518
* [asan] Fix interception unittest on Windows64.Etienne Bergeron2016-07-121-0/+10
| | | | | | | | | | | | | mov edi,edi is _not_ NOP in 64-bit, use 66,90h instead. This bug was causing interception unittest to crash on Windows64 (windows 8 and windows 10). Credits to etienneb for finding the root cause. Patch by: Wei Wang Differential Revision: http://reviews.llvm.org/D22274 llvm-svn: 275207
* [compiler-rt] Refactor the interception code on windows.Etienne Bergeron2016-07-111-69/+428
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [compiler-rt] Enhance unittest coverage for lib interceptionEtienne Bergeron2016-07-071-15/+96
| | | | | | | | | | | | | | Summary: This patch is adding more unittests for testing the interception of 32-bits code. Reviewers: rnk Subscribers: llvm-commits, wang0109, chrisha Differential Revision: http://reviews.llvm.org/D22077 llvm-svn: 274775
* [compilter-rt] Add unittests for interception libraryEtienne Bergeron2016-07-061-0/+142
Summary: This patch is adding unittests for the interception library. Reviewers: rnk Subscribers: majnemer, llvm-commits, wang0109, chrisha, tberghammer, danalbert, srhines Differential Revision: http://reviews.llvm.org/D21980 llvm-svn: 274657
OpenPOWER on IntegriCloud