ramosian-glider / memory-sanitizer

Automatically exported from code.google.com/p/memory-sanitizer
0 stars 0 forks source link

false positive with dtls #44

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
lib/msan/lit_tests/dtls_test.c currently produces a false report
because we don't know the dynamic tls and don't clean its shadow on thread exit.

The behavior is different with glibs < 2.19 and >= 2.19,
see https://groups.google.com/forum/#!topic/address-sanitizer/BfwYD8HMxTM
With < 2.19 dtls will be created by malloc and thus will be poisoned,
with >= 2.19 dtls will be created by mmap and this will not be poisoned,
but we still must unpoison it on thread exit.

We'l need to use the new __tls_get_addr interceptor machinery 
to clean shadow for dtls on its creation and on thread exit.

Most of the code is already there 
(lib/sanitizer_common/sanitizer_tls_get_addr.h)

Original issue reported on code.google.com by konstant...@gmail.com on 29 Jan 2014 at 9:42

GoogleCodeExporter commented 8 years ago

Original comment by konstant...@gmail.com on 29 Jan 2014 at 9:42

GoogleCodeExporter commented 8 years ago

Original comment by konstant...@gmail.com on 29 Jan 2014 at 10:33

GoogleCodeExporter commented 8 years ago
Btw, where does ASan clear shadow for DTLS?
I don't see anything like that.
And I think it does not need it either.

Original comment by euge...@google.com on 25 Jun 2014 at 11:02

GoogleCodeExporter commented 8 years ago
'cause thread-locals don't have redzones

Original comment by euge...@google.com on 25 Jun 2014 at 11:03

GoogleCodeExporter commented 8 years ago
Fixed:
http://llvm.org/viewvc/llvm-project?view=revision&revision=211683

Original comment by euge...@google.com on 25 Jun 2014 at 11:39

GoogleCodeExporter commented 8 years ago
Adding Project:MemorySanitizer as part of GitHub migration.

Original comment by gli...@google.com on 30 Jul 2015 at 9:22