8sa1-gcc/libsanitizer
Matthew Malcomson 8eb12742e8 libsanitizer: 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.

Cherry-pick from 83ac18205ec69a00ac2be3b603bc3a61293fbe89.

Differential Revision: https://reviews.llvm.org/D91344
2020-11-25 16:35:31 +00:00
..
asan libsanitizer: Apply local patches. 2020-11-13 17:29:28 +01:00
builtins Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
hwasan libsanitizer: Hwasan reporting check for dladdr failing 2020-11-25 16:35:31 +00:00
include libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
interception libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
libbacktrace libsanitizer: rename new libbacktrace symbols 2020-09-21 12:03:45 -07:00
lsan libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_common libsanitizer: Apply local patches. 2020-11-13 17:29:28 +01:00
tsan libsanitizer: Apply local patches. 2020-11-13 17:29:28 +01:00
ubsan libsanitizer: Apply local patches. 2020-11-13 17:29:28 +01:00
acinclude.m4
aclocal.m4 Add `--with-toolexeclibdir=' configuration option 2020-01-24 11:24:25 +00:00
ChangeLog Daily bump. 2020-11-22 00:16:24 +00:00
config.h.in
configure Avoid nested save_CFLAGS and save_LDFLAGS 2020-05-29 12:56:40 -07:00
configure.ac Add `--with-toolexeclibdir=' configuration option 2020-01-24 11:24:25 +00:00
configure.tgt Darwin, libsanitizer : Support libsanitizer for x86_64-darwin20. 2020-11-21 08:56:41 +00:00
HOWTO_MERGE Remove references to SVN in libsanitizer. 2020-05-29 11:50:54 +02:00
libsanitizer.spec.in
LICENSE.TXT
LOCAL_PATCHES libsanitizer: update LOCAL_PATCHES. 2020-11-13 17:31:16 +01:00
Makefile.am
Makefile.in Add `--with-toolexeclibdir=' configuration option 2020-01-24 11:24:25 +00:00
MERGE libsanitizer: add hwasan. 2020-11-25 16:35:30 +00:00
merge.sh libsanitizer: add hwasan. 2020-11-25 16:35:30 +00:00
README.gcc libsanitizer: add hwasan. 2020-11-25 16:35:30 +00:00

AddressSanitizer and ThreadSanitizer (https://github.com/google/sanitizers) are
projects initially developed by Google Inc.

Both tools consist of a compiler module and a run-time library.
The sources of the run-time library for these projects are hosted at
https://github.com/llvm/llvm-project in the following directories:
  compiler-rt/include/sanitizer
  compiler-rt/lib/sanitizer_common
  compiler-rt/lib/interception
  compiler-rt/lib/asan
  compiler-rt/lib/tsan
  compiler-rt/lib/lsan
  compiler-rt/lib/ubsan
  compiler-rt/lib/hwasan

Trivial and urgent fixes (portability, build fixes, etc.) may go directly to the
GCC tree.  All non-trivial changes, functionality improvements, etc. should go
through the upstream tree first and then be merged back to the GCC tree.
The merges from upstream should be done with the aid of the merge.sh script;
it will also update the file MERGE to contain the upstream revision
we merged with.