llvm-capstone/compiler-rt/lib
Kostya Kortchinsky 77e906ac78 [scudo][standalone] Implement TSD registry disabling
Summary:
In order to implement `malloc_{enable|disable}` we were just disabling
(or really locking) the Primary and the Secondary. That meant that
allocations could still be serviced from the TSD as long as the cache
wouldn't have to be filled from the Primary.

This wasn't working out for Android tests, so this change implements
registry disabling (eg: locking) so that `getTSDAndLock` doesn't
return a TSD if the allocator is disabled. This also means that the
Primary doesn't have to be disabled in this situation.

For the Shared Registry, we loop through all the TSDs and lock them.
For the Exclusive Registry, we add a `Disabled` boolean to the Registry
that forces `getTSDAndLock` to use the Fallback TSD instead of the
thread local one. Disabling the Registry is then done by locking the
Fallback TSD and setting the boolean in question (I don't think this
needed an atomic variable but I might be wrong).

I clang-formatted the whole thing as usual hence the couple of extra
whiteline changes in this CL.

Reviewers: cferris, pcc, hctim, morehouse, eugenis

Subscribers: jfb, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D71719
2019-12-20 06:52:13 -08:00
..
asan Remove unused variables, as suggested by @mcgov. 2019-11-04 14:55:51 -05:00
BlocksRuntime [compiler-rt] Test commit: remove some trailing white spaces. 2017-08-25 19:36:30 +00:00
builtins Revert "Revert 1689ad27af "[builtins] Implement rounding mode support for i386/x86_64"" 2019-11-27 17:29:20 -08:00
cfi Improve error message when '=' is missing in {ASAN,...}_OPTIONS. 2019-06-15 01:37:14 +00:00
crt Revert "Support powerpc when builing without init_array." 2019-12-19 11:25:14 +01:00
dfsan [compiler-rt] Remove some cpplint filters 2019-09-12 02:20:36 +00:00
fuzzer [compiler-rt] [fuzzer] Include stdarg.h for va_list 2019-12-19 01:11:39 +01:00
gwp_asan [GWP-ASan] 32-bit test pointers, allow multi-init for test. 2019-12-09 08:19:54 -08:00
hwasan [hwasan] Offline symbolization script. 2019-12-09 13:46:11 -08:00
interception Fix check-interception link error in compiler-rt debug mode 2019-10-10 23:30:54 +00:00
lsan [sanitizer_common] Create max_allocation_size_mb flag. 2019-10-30 11:26:05 -07:00
msan [SanitizerCommon] Print the current value of options when printing out help. 2019-11-14 14:04:34 -08:00
profile [compiler-rt] Add a critical section when flushing gcov counters 2019-12-12 09:23:32 +01:00
safestack compiler-rt: Rename .cc file in lib/{interception/tests,safestack} to .cpp 2019-08-01 13:56:52 +00:00
sanitizer_common [compiler-rt] Enable SANITIZER_CAN_USE_PREINIT_ARRAY on NetBSD 2019-12-19 03:23:51 +01:00
scudo [scudo][standalone] Implement TSD registry disabling 2019-12-20 06:52:13 -08:00
stats compiler-rt: Rename .cc file in lib/{dfsan,stats,ubsan_minimal} to .cpp 2019-08-01 12:41:23 +00:00
tsan [TSan][Darwin] Avoid calling pthread_self() before libpthread is initialized 2019-12-16 13:10:51 -08:00
ubsan [UBSan] Appease linter 2019-10-10 11:32:06 +00:00
ubsan_minimal compiler-rt: Rename .cc file in lib/{dfsan,stats,ubsan_minimal} to .cpp 2019-08-01 12:41:23 +00:00
xray Re-land "[compiler-rt] Migrate llvm::make_unique to std::make_unique" 2019-08-15 14:57:44 +00:00
CMakeLists.txt Reland "[compiler-rt] Simple crtbegin.o and crtend.o implementation" 2019-04-30 18:13:22 +00:00