[PATCH] D23318: [PATCH] tsan: Remove __pointer_chk_guard at GLIBC_PRIVATE requirement for AArch64

Adhemerval Zanella via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 9 07:22:25 PDT 2016


zatrazz created this revision.
zatrazz added reviewers: samsonov, kcc, aizatsky, dvyukov.
zatrazz added a subscriber: llvm-commits.
zatrazz added a project: Sanitizers.
Herald added subscribers: kubabrecka, rengolin, aemerson.

Current AArch64 {sig}{set,long}jmp interposing requires accessing glibc
private __pointer_chk_guard to get process xor mask to demangled the
internal {sig}jmp_buf function pointers.

It causes some packing issues, as described in gcc PR#71042 [1], and is
is not a godd practice to rely on a private glibc namespace (since ABI is
not meant to be stable).

This patch fixes it by changing how libtsan obtains the guarded pointer
value: at initialization a specific routine issues a setjmp call and
using the mangled function pointer and the original value derive the
random guarded pointer.

Checked on aarch64 39-bit VMA.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71042

https://reviews.llvm.org/D23318

Files:
  lib/tsan/rtl/tsan_platform_linux.cc
  lib/tsan/rtl/tsan_rtl_aarch64.S

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23318.67342.patch
Type: text/x-patch
Size: 4664 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160809/881b4f3b/attachment.bin>


More information about the llvm-commits mailing list