[PATCH] D14921: [sanitizer] Don't use ARM_VFPREGS_SIZE for old kernels.

Maxim Ostapenko via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 23 07:24:19 PST 2015


m.ostepenko updated this revision to Diff 40928.
m.ostepenko added a comment.

Ugh, just noticed, that PTRACE_SETVFPREGS and PTRACE_GETVFPREGS were introduced in Linux 2.6.30 and ARM_VFPREGS_SIZE only in 3.0. So, struct_user_vfpregs_struct_sz = 0 is not safe for 2.6.30 - 2.6.39. Fix by defining ARM_VFPREGS_SIZE as 32 * 8 /*fpregs*/ + 4 /*fpscr*/ for these kernels.


Repository:
  rL LLVM

http://reviews.llvm.org/D14921

Files:
  lib/sanitizer_common/sanitizer_platform_limits_posix.cc

Index: lib/sanitizer_common/sanitizer_platform_limits_posix.cc
===================================================================
--- lib/sanitizer_common/sanitizer_platform_limits_posix.cc
+++ lib/sanitizer_common/sanitizer_platform_limits_posix.cc
@@ -123,6 +123,9 @@
 #  include <asm/ptrace.h>
 #  ifdef __arm__
 typedef struct user_fpregs elf_fpregset_t;
+#   if !defined(ARM_VFPREGS_SIZE)
+#     define ARM_VFPREGS_SIZE (32 * 8 /*fpregs*/ + 4 /*fpscr*/)
+#   endif
 #  endif
 # endif
 # include <semaphore.h>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14921.40928.patch
Type: text/x-patch
Size: 515 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151123/78c947d2/attachment.bin>


More information about the llvm-commits mailing list