llvm-project/compiler-rt/lib
Matthew Malcomson 83ac18205e Hwasan reporting check for dladdr failing
In `GetGlobalSizeFromDescriptor` we use `dladdr` to get info on the the
current address.  `dladdr` returns 0 if it failed.
During testing on Linux this returned 0 to indicate failure, and
populated the `info` structure with a NULL pointer which was
dereferenced later.

This patch checks for `dladdr` returning 0, and in that case returns 0
from `GetGlobalSizeFromDescriptor` to indicate failure of identifying
the address.

This occurs when `GetModuleNameAndOffsetForPC` succeeds for some address
not in a dynamically loaded library.  One example is when the found
"module" is '[stack]' having come from parsing /proc/self/maps.

Differential Revision: https://reviews.llvm.org/D91344
2020-11-16 12:25:27 +00:00
..
BlocksRuntime
asan Reland [lsan] Enable LSAN for Android 2020-11-04 18:00:25 -08:00
builtins [builtins] Add support for single-precision-only-FPU ARM targets. 2020-11-12 15:10:48 +00:00
cfi [sanitizers] Remove unneeded MaybeCall*DefaultOptions() and nullptr checks 2020-09-08 10:12:05 -07:00
crt [cmake] Strip quotes in compiler-rt/lib/crt; error if checks fail 2020-03-09 15:52:39 -07:00
dfsan Add a simple stack trace printer for DFSan 2020-11-11 19:00:59 +00:00
fuzzer [fuzzer] Add Windows Visual C++ exception intercept 2020-11-12 13:11:14 -08:00
gwp_asan [GWP-ASan] Stub out backtrace/signal functions on Fuchsia 2020-11-02 13:49:50 -08:00
hwasan Hwasan reporting check for dladdr failing 2020-11-16 12:25:27 +00:00
interception [sanitizer] Remove -Wno-non-virtual-dtor 2020-11-04 00:51:33 -08:00
lsan [NFC] Fix cpplint warnings 2020-11-04 22:56:08 -08:00
memprof [memprof] Don't protect destructor in final 2020-11-03 11:33:33 -08:00
msan [sanitizer] Cleanup -Wnon-virtual-dtor warnings 2020-11-02 20:30:50 -08:00
profile [CMake] Add -fno-rtti into tsan unittests 2020-10-30 20:03:38 -07:00
safestack compiler-rt: Rename .cc file in lib/{interception/tests,safestack} to .cpp 2019-08-01 13:56:52 +00:00
sanitizer_common [sanitizer] Fix StackDepotPrint testing 2020-11-16 03:07:29 -08:00
scudo [scudo/standalone] Fix leak in ThreadedGlobalQuarantine test 2020-11-13 22:24:44 -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 [NFC][tsan] Simplify call_pthread_cancel_with_cleanup 2020-11-16 04:21:27 -08:00
ubsan [compiler-rt] [ubsan] Use the itanium type info lookup for mingw targets 2020-11-03 09:59:08 +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 [CMake] Avoid accidental C++ standard library dependency in sanitizers 2020-10-31 02:37:38 -07:00
CMakeLists.txt [MemProf] Decouple memprof build from COMPILER_RT_BUILD_SANITIZERS 2020-10-26 13:52:50 -07:00