[ASAN] Add interceptor for __longjmp_chk
authorPeter Wu <peter@lekensteyn.nl>
Thu, 4 May 2017 14:03:57 +0000 (14:03 +0000)
committerPeter Wu <peter@lekensteyn.nl>
Thu, 4 May 2017 14:03:57 +0000 (14:03 +0000)
commitdbc4f7413c410869c2a04fdd969a2eacca770f8a
tree0bbd62fe1ecbb0ef012d23666458927fa4fc0875
parentce4518f21d55eee34d891db39baaeb471ee79397
[ASAN] Add interceptor for __longjmp_chk

Summary:
glibc on Linux calls __longjmp_chk instead of longjmp (or _longjmp) when
_FORTIFY_SOURCE is defined. Ensure that an ASAN-instrumented program
intercepts this function when a system library calls it, otherwise the
stack might remain poisoned and result in CHECK failures and false
positives.

Fixes https://github.com/google/sanitizers/issues/721

Reviewed By: eugenis

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

llvm-svn: 302152
compiler-rt/lib/asan/asan_interceptors.cc
compiler-rt/lib/asan/asan_interceptors.h
compiler-rt/test/asan/TestCases/Linux/longjmp_chk.c [new file with mode: 0644]