summaryrefslogtreecommitdiff
path: root/test/hwasan
AgeCommit message (Collapse)Author
2018-06-08[HWASan] Disable allocator_returns_null.cc test on Android.Alex Shlyapnikov
Disable test added in D47798 on Android and investigate why "new" behaves differently there. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334255 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-07[HWASan] Report proper error on allocator failures instead of CHECK(0)-ingAlex Shlyapnikov
Summary: Currently many allocator specific errors (OOM, for example) are reported as a text message and CHECK(0) termination, not stack, no details, not too helpful nor informative. To improve the situation, detailed and structured errors were defined and reported under the appropriate conditions. Reviewers: eugenis Subscribers: kubamracek, delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D47798 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334248 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-18[HWASan] Add "N" suffix to generic __hwasan_load/store.Alex Shlyapnikov
Summary: "N" suffix is added by the instrumentation and interface functions are expected to be exported from the library as __hwasan_loadN* and __hwasan_storeN*. Reviewers: eugenis Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D45739 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@330297 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-27[HWASan] Make use-after-free c, not c++ test.Alex Shlyapnikov
To minimize testing surface (remove libstdc++ from the picture, for one), make use-after-free c, not c++ test. Differential Revision: https://reviews.llvm.org/D44705 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@328646 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-27[HWASan] Relax use-after-free.cc test matching rules.Alex Shlyapnikov
Relax use-after-free.cc test matching rules to cover more malloc/free interceptor names variations. Differential Revision: https://reviews.llvm.org/D44705 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@328630 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-24[HWASan] Fix use-after-free.cc test on x86-64Alex Shlyapnikov
Differential Revision: https://reviews.llvm.org/D44705 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@328407 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-13[hwasan] An LLVM flag to disable stack tag randomization.Evgeniy Stepanov
Summary: Necessary to achieve consistent test results. Reviewers: kcc, alekseyshl Subscribers: kubamracek, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D42023 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@322429 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-11[hwasan] Stack instrumentation.Evgeniy Stepanov
Summary: Very basic stack instrumentation using tagged pointers. Tag for N'th alloca in a function is built as XOR of: * base tag for the function, which is just some bits of SP (poor man's random) * small constant which is a function of N. Allocas are aligned to 16 bytes. On every ReturnInst allocas are re-tagged to catch use-after-return. This implementation has a bunch of issues that will be taken care of later: 1. lifetime intrinsics referring to tagged pointers are not recognized in SDAG. This effectively disables stack coloring. 2. Generated code is quite inefficient. There is one extra instruction at each memory access that adds the base tag to the untagged alloca address. It would be better to keep tagged SP in a callee-saved register and address allocas as an offset of that XOR retag, but that needs better coordination between hwasan instrumentation pass and prologue/epilogue insertion. 3. Lifetime instrinsics are ignored and use-after-scope is not implemented. This would be harder to do than in ASan, because we need to use a differently tagged pointer depending on which lifetime.start / lifetime.end the current instruction is dominated / post-dominated. Reviewers: kcc, alekseyshl Subscribers: srhines, kubamracek, javed.absar, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D41602 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@322324 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-10[hwasan] An option to disable tag randomization.Evgeniy Stepanov
Summary: Avoid flaky test failures by by using a monotonic number sequence of heap tags. Does not affect stack tags: the way we generate those guarantees uniqueness for at least 30-something first allocas in any function, as well as the UAR tag. Reviewers: alekseyshl, kcc Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D41882 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@322214 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-20[hwasan] Implement -fsanitize-recover=hwaddress.Evgeniy Stepanov
Summary: Very similar to AddressSanitizer, with the exception of the error type encoding. Reviewers: kcc, alekseyshl Subscribers: cfe-commits, kubamracek, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D41417 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@321203 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-20[hwasan] Remove --check-prefix=CHECK (NFC)Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@321141 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-19[hwasan] Fix handling of store errors.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@321121 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-19[hwasan] Remove unused -check-prefix in tests.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@321119 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13[hwasan] Inline instrumentation & fixed shadow.Evgeniy Stepanov
Summary: This brings CPU overhead on bzip2 down from 5.5x to 2x. Reviewers: kcc, alekseyshl Subscribers: kubamracek, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D41137 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320538 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09Hardware-assisted AddressSanitizer (compiler-rt)Evgeniy Stepanov
Summary: Runtime library for HWASan, initial commit. Does not randomize tags yet, does not handle stack or globals. Reviewers: kcc, pcc, alekseyshl Subscribers: srhines, kubamracek, dberris, mgorny, llvm-commits, krytarowski Differential Revision: https://reviews.llvm.org/D40935 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320231 91177308-0d34-0410-b5e6-96231b3b80d8