[asan] Add __libc_siglongjmp/__libc_longjmp interceptors 31/196431/3 accepted/tizen/base/20190308.035726 submit/tizen_base/20190225.004849
authorMikhail Kashkarov <m.kashkarov@partner.samsung.com>
Thu, 27 Dec 2018 09:42:37 +0000 (12:42 +0300)
committerDongkyun Son <dongkyun.s@samsung.com>
Thu, 21 Feb 2019 13:46:24 +0000 (13:46 +0000)
Change-Id: Ic247cb33f17743fa597b3a74baf7cf31c075165d

libsanitizer/asan/asan_interceptors.cc
libsanitizer/asan/asan_interceptors.h

index 1678372..2e99a7f 100644 (file)
@@ -386,6 +386,20 @@ INTERCEPTOR(void, siglongjmp, void *env, int val) {
 }
 #endif
 
+#if ASAN_INTERCEPT__LIBC_SIGLONGJMP
+INTERCEPTOR(void, __libc_siglongjmp, void *env, int val) {
+  __asan_handle_no_return();
+  REAL(__libc_siglongjmp)(env, val);
+}
+#endif
+
+#if ASAN_INTERCEPT__LIBC_LONGJMP
+INTERCEPTOR(void, __libc_longjmp, void *env, int val) {
+  __asan_handle_no_return();
+  REAL(__libc_longjmp)(env, val);
+}
+#endif
+
 #if ASAN_INTERCEPT___CXA_THROW
 INTERCEPTOR(void, __cxa_throw, void *a, void *b, void *c) {
   CHECK(REAL(__cxa_throw));
@@ -870,6 +884,12 @@ void InitializeAsanInterceptors() {
 #if ASAN_INTERCEPT_SIGLONGJMP
   ASAN_INTERCEPT_FUNC(siglongjmp);
 #endif
+#if ASAN_INTERCEPT__LIBC_SIGLONGJMP
+  ASAN_INTERCEPT_FUNC(__libc_siglongjmp);
+#endif
+#if ASAN_INTERCEPT__LIBC_LONGJMP
+  ASAN_INTERCEPT_FUNC(__libc_longjmp);
+#endif
 
   // Intercept exception handling functions.
 #if ASAN_INTERCEPT___CXA_THROW
index 706729c..1d9f30b 100644 (file)
 
 #if SANITIZER_LINUX && !SANITIZER_ANDROID
 # define ASAN_INTERCEPT_SWAPCONTEXT 1
+# define ASAN_INTERCEPT__LIBC_SIGLONGJMP 1
+# define ASAN_INTERCEPT__LIBC_LONGJMP 1
 #else
 # define ASAN_INTERCEPT_SWAPCONTEXT 0
+# define ASAN_INTERCEPT__LIBC_SIGLONGJMP 0
+# define ASAN_INTERCEPT__LIBC_LONGJMP 0
 #endif
 
 #if !SANITIZER_WINDOWS