[all-commits] [llvm/llvm-project] 6b4aee: [asan] Unpoison signal alternate stack.

Vitaly Buka via All-commits all-commits at lists.llvm.org
Tue Jun 16 02:29:01 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 6b4aeec94afc3626c19ed93dea5d158fbea29732
      https://github.com/llvm/llvm-project/commit/6b4aeec94afc3626c19ed93dea5d158fbea29732
  Author: Vitaly Buka <vitalybuka at google.com>
  Date:   2020-06-16 (Tue, 16 Jun 2020)

  Changed paths:
    M compiler-rt/lib/asan/asan_posix.cpp
    A compiler-rt/test/asan/TestCases/Posix/unpoison-alternate-stack.cpp

  Log Message:
  -----------
  [asan] Unpoison signal alternate stack.

Summary:
Before unwinding the stack, `__asan_handle_no_return` is supposed to
unpoison the entire stack - that is, remove the entries in the shadow
memory corresponding to stack (e.g. redzone markers around variables).
This does not work correctly if `__asan_handle_no_return` is called from
the alternate stack used in signal handlers, because the stack top is
read from a cache, which yields the default stack top instead of the
signal alternate stack top.

It is also possible to jump between the default stack and the signal
alternate stack. Therefore, __asan_handle_no_return needs to unpoison
both.

Reviewers: vitalybuka, kubamracek, kcc, eugenis

Reviewed By: vitalybuka

Subscribers: phosek, #sanitizers

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D76986




More information about the All-commits mailing list