llvm-project/compiler-rt/lib
Matt Morehouse 846ec2c3cc [HWASan] Ensure RNG is initialized in GenerateRandomTag
Fixes a CHECK-failure caused by glibc's pthread_getattr_np
implementation calling realloc.  Essentially, Thread::GenerateRandomTag
gets called during Thread::Init and before Thread::InitRandomState:

  HWAddressSanitizer: CHECK failed: hwasan_thread.cpp:134 "((random_buffer_)) != (0)" (0x0, 0x0) (tid=314)
    #0 0x55845475a662 in __hwasan::CheckUnwind()
    #1 0x558454778797 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long)
    #2 0x558454766461 in __hwasan::Thread::GenerateRandomTag(unsigned long)
    #3 0x55845475c58b in __hwasan::HwasanAllocate(__sanitizer::StackTrace*, unsigned long, unsigned long, bool)
    #4 0x55845475c80a in __hwasan::hwasan_realloc(void*, unsigned long, __sanitizer::StackTrace*)
    #5 0x5584547608aa in realloc
    #6 0x7f6f3a3d8c2c in pthread_getattr_np
    #7 0x5584547790dc in __sanitizer::GetThreadStackTopAndBottom(bool, unsigned long*, unsigned long*)
    #8 0x558454779651 in __sanitizer::GetThreadStackAndTls(bool, unsigned long*, unsigned long*, unsigned long*, unsigned long*)
    #9 0x558454761bca in __hwasan::Thread::InitStackAndTls(__hwasan::Thread::InitState const*)
    #10 0x558454761e5c in __hwasan::HwasanThreadList::CreateCurrentThread(__hwasan::Thread::InitState const*)
    #11 0x55845476184f in __hwasan_thread_enter
    #12 0x558454760def in HwasanThreadStartFunc(void*)
    #13 0x7f6f3a3d6fa2 in start_thread
    #14 0x7f6f3a15b4ce in __clone

Also reverts 7a3fb71c3c, as it's now
unneeded.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D113045
2021-11-09 07:01:55 -08:00
..
BlocksRuntime
asan Enable -Wformat-pedantic and fix fallout. 2021-11-05 13:12:35 +01:00
builtins [clang][compiler-rt][atomics] Add `__c11_atomic_fetch_nand` builtin and support `__atomic_fetch_nand` libcall 2021-10-28 02:18:43 +00:00
cfi Enable -Wformat-pedantic and fix fallout. 2021-11-05 13:12:35 +01:00
crt [cmake] By default do not instrument compiler-rt if LLVM_BUILD_INSTRUMENTED_COVERAGE is ON 2021-11-09 10:59:25 +01:00
dfsan [NFC][dfsan] Split Init and ThreadStart 2021-11-08 19:16:55 -08:00
fuzzer [libFuzzer] Disable Msan on InternalStrnlen 2021-11-05 15:24:09 -07:00
gwp_asan Fix a few warnings (signed/unsigned comparison in gtest, and missing field initializers) 2021-10-16 22:43:57 -07:00
hwasan [HWASan] Ensure RNG is initialized in GenerateRandomTag 2021-11-09 07:01:55 -08:00
interception [compiler-rt] [windows] Add more assembly patterns for interception 2021-09-21 15:51:58 -07:00
lsan Fix -Wformat warnings reported by GCC. 2021-11-04 08:51:43 +01:00
memprof Enable -Wformat-pedantic and fix fallout. 2021-11-05 13:12:35 +01:00
msan Partially revert "[NFC][msan] Split ThreadStart and Init" 2021-11-08 19:16:55 -08:00
orc [ORC-RT] Add SPS serialization for span<const char> / SPSSequence<char>. 2021-11-03 13:43:49 -07:00
profile Revert "[compiler-rt/profile] Hide __llvm_profile_raw_version" 2021-10-21 10:56:43 -07:00
safestack Revert "sanitizers: increase .clang-format columns to 100" 2021-07-28 09:40:21 +02:00
sanitizer_common [NFC] Move setuid.c test into sanitizer_common 2021-11-08 18:24:01 -08:00
scudo [scudo] Fix running tests under hwasan. 2021-10-14 14:56:58 -07:00
stats compiler-rt: Rename .cc file in lib/{dfsan,stats,ubsan_minimal} to .cpp 2019-08-01 12:41:23 +00:00
tsan add tsan shared lib 2021-11-09 02:34:37 +00:00
ubsan ubsan: fix few format string bugs 2021-08-13 13:45:23 +02:00
ubsan_minimal [compiler-rt] Suppress -Wunused-result due to ::write when _FORTIFY_SOURCE>0 in glibc 2020-10-12 09:57:12 -07:00
xray Enable -Wformat-pedantic and fix fallout. 2021-11-05 13:12:35 +01:00
CMakeLists.txt [ORC-RT] Re-apply "Initial ORC Runtime directories and build..." with fixes. 2021-04-24 16:00:20 -07:00