[PATCH] D69191: scudo: Update TLS_SLOT_SANITIZER value.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 18 12:30:50 PDT 2019


pcc created this revision.
pcc added reviewers: cryptoad, eugenis, rprichard.
Herald added projects: Sanitizers, LLVM.
Herald added a subscriber: Sanitizers.

Android now allocates only 8 fixed TLS slots. Somehow we were getting away
with using a non-existent slot until now, but in some cases the TLS slots
were being placed at the end of a page, which led to a segfault at startup.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D69191

Files:
  compiler-rt/lib/scudo/standalone/linux.h


Index: compiler-rt/lib/scudo/standalone/linux.h
===================================================================
--- compiler-rt/lib/scudo/standalone/linux.h
+++ compiler-rt/lib/scudo/standalone/linux.h
@@ -55,7 +55,7 @@
 // The Android Bionic team has allocated a TLS slot for sanitizers starting
 // with Q, given that Android currently doesn't support ELF TLS. It is used to
 // store sanitizer thread specific data.
-static const int TLS_SLOT_SANITIZER = 8; // TODO(kostyak): 6 for Q!!
+static const int TLS_SLOT_SANITIZER = 6;
 
 ALWAYS_INLINE uptr *getAndroidTlsPtr() {
   return reinterpret_cast<uptr *>(&__get_tls()[TLS_SLOT_SANITIZER]);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69191.225677.patch
Type: text/x-patch
Size: 649 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191018/fd77820e/attachment.bin>


More information about the llvm-commits mailing list