[PATCH] D60593: [GwpAsan] Introduce GWP-ASan.
Vlad Tsyrklevich via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 24 18:29:07 PDT 2019
vlad.tsyrklevich added inline comments.
================
Comment at: compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp:213
+ return 0;
+ else if (Ptr > GetGuardedPagePoolEnd() - PageSize)
+ return NumGuardedSlots - 1;
----------------
morehouse wrote:
> Nit: else is unnecessary.
I believe it's required for the case when the OOB access happens in the second half of the last guard page.
================
Comment at: compiler-rt/lib/gwp_asan/guarded_pool_allocator.h:162
+ // slots are available.
+ bool reserveSlot(std::size_t *PageIndex);
+
----------------
morehouse wrote:
> `ssize_t reserveSlot()` seems cleaner to me. Also the function comment could be reworded clearer.
I think this is because it's modeled on my implementation since with my design I reserve slots/metadata indices separately.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D60593/new/
https://reviews.llvm.org/D60593
More information about the llvm-commits
mailing list