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

Adhemerval Zanella via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 12 13:29:08 PDT 2015


zatrazz created this revision.
zatrazz added reviewers: kcc, pcc, rengolin, eugenis, samsonov.
zatrazz added a subscriber: llvm-commits.
Herald added subscribers: rengolin, aemerson.

This patch fixes the ptrace interceptor for aarch64. The PTRACE_GETREGSET
ptrace syscall with with invalid memory might zero the iovec::iov_base
field and then masking the subsequent check after the syscall (since it
will be 0 and it will not trigger an invalid access). The fix is to copy
the value on a local variable and use its value on the check.

The patch also adds more coverage on the Linux/ptrace.cc testcase by addding
check for PTRACE_GETREGSET for both general and floating registers (aarch64
definitions added only).

http://reviews.llvm.org/D13670

Files:
  lib/sanitizer_common/sanitizer_common_interceptors.inc
  test/asan/TestCases/Linux/ptrace.cc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13670.37159.patch
Type: text/x-patch
Size: 4679 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151012/a136c96e/attachment.bin>


More information about the llvm-commits mailing list