summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitch Phillips <31459023+hctim@users.noreply.github.com>2021-05-10 12:19:19 -0700
committerCopybara-Service <copybara-worker@google.com>2021-05-11 12:41:25 -0700
commit875cd44ff6d471315c29c9dda43d1814c7909168 (patch)
tree5e1e85016be16b395eef3d2c25a902ee8fa01c58
parente2919d1a603bd2cbb7c7c5118b304dfc25a16282 (diff)
downloadgwp_asan-875cd44ff6d471315c29c9dda43d1814c7909168.tar.gz
[Scudo] Use GWP-ASan's aligned allocations and fixup postalloc hooks.android-s-beta-2android-s-beta-1
This patch does a few cleanup things: 1. The non-standalone scudo has a problem where GWP-ASan allocations may not meet alignment requirements where Scudo was requested to have alignment >= 16. Use the new GWP-ASan API to fix this. 2. The standalone variant loses some debugging information inside of GWP-ASan because we ask GWP-ASan to allocate an aligned size in the frontend. This means reports end up with 'UaF on a 16-byte allocation' for a 1-byte allocation with 16-byte alignment. Also use the new API to fix this. 3. Add post-alloc hooks for GWP-ASan intercepted allocations, and add stats tracking for GWP-ASan allocations. 4. Add a small test that checks the alignment of the frontend allocator, so that it can be used under GWP-ASan torture mode. 5. Add GWP-ASan torture mode as a testing configuration to catch these regressions. Depends on D94830, D95889. Reviewed By: cryptoad Differential Revision: https://reviews.llvm.org/D95884 GitOrigin-RevId: e78b64df98878d1da56275e0c272ed58364da3ad Change-Id: I9b7f7503e1b1fc3a57788e84231714588d796b5c
-rw-r--r--gwp_asan/common.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/gwp_asan/common.h b/gwp_asan/common.h
index ee8f9d1..7ce367e 100644
--- a/gwp_asan/common.h
+++ b/gwp_asan/common.h
@@ -83,6 +83,8 @@ struct AllocationMetadata {
// crash handler. This, in conjunction with the Metadata array, forms the entire
// set of information required for understanding a GWP-ASan crash.
struct AllocatorState {
+ constexpr AllocatorState() {}
+
// Returns whether the provided pointer is a current sampled allocation that
// is owned by this pool.
GWP_ASAN_ALWAYS_INLINE bool pointerIsMine(const void *Ptr) const {