diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2019-02-21 21:55:06 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2019-02-21 21:55:06 +0000 |
commit | 0733cd3710e924eb8452338480e27db71c35910f (patch) | |
tree | c3a9aab9344378850b2c2746f3022d5fca5a4337 /lib/asan | |
parent | 806f4749b8116d9ad554e723779e3fcfa8761b74 (diff) | |
download | compiler-rt-0733cd3710e924eb8452338480e27db71c35910f.tar.gz |
[asan] Fix vfork handling.
__asan_handle_vfork was unpoisoning the wrong part of the stack.
Adjust the test to catch this reliably (current failure is
non-deterministic).
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@354627 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan')
-rw-r--r-- | lib/asan/asan_rtl.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/asan/asan_rtl.cc b/lib/asan/asan_rtl.cc index f68373809..f5ebef3c8 100644 --- a/lib/asan/asan_rtl.cc +++ b/lib/asan/asan_rtl.cc @@ -606,10 +606,8 @@ void *__asan_extra_spill_area() { void __asan_handle_vfork(void *sp) { AsanThread *t = GetCurrentThread(); CHECK(t); - uptr PageSize = GetPageSizeCached(); - uptr top = t->stack_top(); - uptr bottom = ((uptr)sp - PageSize) & ~(PageSize - 1); - PoisonShadow(bottom, top - bottom, 0); + uptr bottom = t->stack_bottom(); + PoisonShadow(bottom, (uptr)sp - bottom, 0); } void NOINLINE __asan_set_death_callback(void (*callback)(void)) { |