[compiler-rt] r325276 - [TSan] Fix static TLS boundaries calculations in __tls_get_addr interceptor.

Alex Shlyapnikov via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 15 10:58:31 PST 2018


Author: alekseyshl
Date: Thu Feb 15 10:58:31 2018
New Revision: 325276

URL: http://llvm.org/viewvc/llvm-project?rev=325276&view=rev
Log:
[TSan] Fix static TLS boundaries calculations in __tls_get_addr interceptor.

Summary:
DTLS_on_tls_get_addr expects (tls_addr + tls_size) as the last
parameter, static_tls_end.

Reviewers: dvyukov

Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits

Differential Revision: https://reviews.llvm.org/D43325

Modified:
    compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc

Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc?rev=325276&r1=325275&r2=325276&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc Thu Feb 15 10:58:31 2018
@@ -2535,7 +2535,8 @@ TSAN_INTERCEPTOR(void *, __tls_get_addr,
   ThreadState *thr = cur_thread();
   if (!thr)
     return res;
-  DTLS::DTV *dtv = DTLS_on_tls_get_addr(arg, res, thr->tls_addr, thr->tls_size);
+  DTLS::DTV *dtv = DTLS_on_tls_get_addr(arg, res, thr->tls_addr,
+                                        thr->tls_addr + thr->tls_size);
   if (!dtv)
     return res;
   // New DTLS block has been allocated.




More information about the llvm-commits mailing list