diff options
author | Vitaly Buka <vitalybuka@google.com> | 2016-08-18 00:56:11 +0000 |
---|---|---|
committer | Vitaly Buka <vitalybuka@google.com> | 2016-08-18 00:56:11 +0000 |
commit | b2d566d1e9b8d7a5d1741252765e1d32fb535995 (patch) | |
tree | 6263631a66694ac8df590783dcae8cb385a588f0 /lib/asan/asan_poisoning.cc | |
parent | e5fb2bab9b4c954426948b4431fbb3c79d6fa507 (diff) |
[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
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279019 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_poisoning.cc')
-rw-r--r-- | lib/asan/asan_poisoning.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/asan/asan_poisoning.cc b/lib/asan/asan_poisoning.cc index 65c44019d..e1a3f2d6d 100644 --- a/lib/asan/asan_poisoning.cc +++ b/lib/asan/asan_poisoning.cc @@ -314,6 +314,30 @@ static void PoisonAlignedStackMemory(uptr addr, uptr size, bool do_poison) { } } +void __asan_set_shadow_00(uptr addr, uptr size) { + REAL(memset)((void *)addr, 0, size); +} + +void __asan_set_shadow_f1(uptr addr, uptr size) { + REAL(memset)((void *)addr, 0xf1, size); +} + +void __asan_set_shadow_f2(uptr addr, uptr size) { + REAL(memset)((void *)addr, 0xf2, size); +} + +void __asan_set_shadow_f3(uptr addr, uptr size) { + REAL(memset)((void *)addr, 0xf3, size); +} + +void __asan_set_shadow_f5(uptr addr, uptr size) { + REAL(memset)((void *)addr, 0xf5, size); +} + +void __asan_set_shadow_f8(uptr addr, uptr size) { + REAL(memset)((void *)addr, 0xf8, size); +} + void __asan_poison_stack_memory(uptr addr, uptr size) { if (!__asan_option_detect_stack_use_after_scope) return; VReport(1, "poisoning: %p %zx\n", (void *)addr, size); |