[scudo] Add GWP-ASan state/metadata pointer proxies.
authorMitch Phillips <31459023+hctim@users.noreply.github.com>
Wed, 11 Aug 2021 16:21:28 +0000 (09:21 -0700)
committerMitch Phillips <31459023+hctim@users.noreply.github.com>
Wed, 11 Aug 2021 16:21:48 +0000 (09:21 -0700)
Provide accessor proxies for the gwp-asan regions that are useful in
symbolizing dumps offline. Should be useful for Fuchsia to be able to
locate these internal pointers to stash the data in a minidump.

Reviewed By: cryptoad

Differential Revision: https://reviews.llvm.org/D107909

compiler-rt/lib/scudo/standalone/combined.h

index fd5360c..922c2e5 100644 (file)
@@ -205,6 +205,16 @@ public:
 #endif // GWP_ASAN_HOOKS
   }
 
+#ifdef GWP_ASAN_HOOKS
+  const gwp_asan::AllocationMetadata *getGwpAsanAllocationMetadata() {
+    return GuardedAlloc.getMetadataRegion();
+  }
+
+  const gwp_asan::AllocatorState *getGwpAsanAllocatorState() {
+    return GuardedAlloc.getAllocatorState();
+  }
+#endif // GWP_ASAN_HOOKS
+
   ALWAYS_INLINE void initThreadMaybe(bool MinimalInit = false) {
     TSDRegistry.initThreadMaybe(this, MinimalInit);
   }