diff options
author | Peter Collingbourne <pcc@google.com> | 2019-08-07 19:06:00 -0700 |
---|---|---|
committer | Peter Collingbourne <pcc@google.com> | 2019-08-15 09:21:34 -0700 |
commit | 191ecdc49ba18fc07d62d419fd51cc7dee4190f8 (patch) | |
tree | bfd1dc23f8fed1ddeee6b62a81623b32159b6799 /libdl | |
parent | 639ad55176c78bfd70c3786a92a05dd3d2299953 (diff) |
Fix a few bionic test failures caused by hwasan global instrumentation.
The call to the load hook needs to be moved before the call to link_image()
because the latter calls ifunc resolvers which might access global
variables. This fixes a bunch of ifunc tests.
The dlfcn.segment_gap test is currently failing. One problem is that the name
of the .bss.end_of_gap section changes as a result of global instrumentation.
Add some wildcards in so that we match both names. The other problem seems
to be the same as b/139089152.
It turns out that we need to untag pointers in a few more places. Since we have
quite a few of these now it seems worth creating a function for it.
Test: bionic-unit-tests
Change-Id: I44e2b0904faacdda7cc0c5e844ffc09de01dea2d
Diffstat (limited to 'libdl')
-rw-r--r-- | libdl/libdl_cfi.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/libdl/libdl_cfi.cpp b/libdl/libdl_cfi.cpp index 14461436c..3b68fc7d3 100644 --- a/libdl/libdl_cfi.cpp +++ b/libdl/libdl_cfi.cpp @@ -44,11 +44,8 @@ extern "C" size_t __cfi_shadow_size() { } static uint16_t shadow_load(void* p) { - uintptr_t addr = reinterpret_cast<uintptr_t>(p); -#ifdef __aarch64__ // Untag the pointer to move it into the address space covered by the shadow. - addr &= (1ULL << 56) - 1; -#endif + uintptr_t addr = reinterpret_cast<uintptr_t>(untag_address(p)); uintptr_t ofs = CFIShadow::MemToShadowOffset(addr); if (ofs > CFIShadow::kShadowSize) return CFIShadow::kInvalidShadow; return *reinterpret_cast<uint16_t*>(shadow_base_storage.v + ofs); |