[PATCH] D13670: [sanitizer] Fix ptrace interceptor for aarch64

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 13 11:28:34 PDT 2015


eugenis added inline comments.

================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:2464
@@ +2463,3 @@
+    else if (request == ptrace_setregset || request == ptrace_getregset) {
+      local_iovec = *(__sanitizer_iovec *)data;
+      if (request == ptrace_setregset)
----------------
Hm, we don't check that __sanitizer_iovec in data is accessible. Would you mind adding a READ_RANGE for that before copying it out?


================
Comment at: test/asan/TestCases/Linux/ptrace.cc:6
@@ -5,3 +5,3 @@
 // RUN: %clangxx_asan -DPOSITIVE -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
-// REQUIRES: x86_64-supported-target,i386-supported-target
+// REQUIRES: x86_64-supported-target,i386-supported-target,aarch64-supported-target
 
----------------
This is impossible. You can not build compiler-rt to support all 3 of those at one time.
UNSUPPORTED: AddressSanitizer-x86_64-linux :: TestCases/Linux/ptrace.cc
UNSUPPORTED: AddressSanitizer-i386-linux :: TestCases/Linux/ptrace.cc

Not sure what's the best solution here. Maybe #ifdef-out the entire test on unsupported platforms?

================
Comment at: test/asan/TestCases/Linux/ptrace.cc:18
@@ +17,3 @@
+#ifdef __aarch64__
+// GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ #include <asm/ptrace.h>
----------------
Does it mean x86_64 run into the same problem soon?


http://reviews.llvm.org/D13670





More information about the llvm-commits mailing list