[PATCH] D60593: [GwpAsan] Introduce GWP-ASan.

Vlad Tsyrklevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 8 09:37:10 PDT 2019


vlad.tsyrklevich added a comment.

One thing I also just realized is that by explicitly setting TLS model to initial-exec we prevent dlopen() dynamic loading, I don't have a problem with that but just wanted to make sure @cryptoad was aware.



================
Comment at: compiler-rt/lib/gwp_asan/gwp_asan_interface_internal.h:1
+//===-- gwp_asan_interface_internal.h ---------------------------*- C++ -*-===//
+//
----------------
morehouse wrote:
> hctim wrote:
> > morehouse wrote:
> > > Why do we want this?
> > To allow us to exercise the allocator directly for testing. The comments in `compiler-rt/test/gwp_asan/num_usable_slots.cpp` has some more context, but the summary is:
> > 
> >   # Allows us to be precise with exactly which allocations are sampled (important, for example, in `tests/num_usable_slots.cpp` where if a library calls malloc() during its init, we will break. Also, in the `thread_contention*` tests, we want to be certain that we are exercising the sampled allocator, rather than potentially falling back to the system allocator.
> >   # Allows us to test directly against the interface whether something is sampled through `__gwp_asan_pointer_is_mine()`, avoiding relying on implementation specific assumptions. In `tests/num_usable_slots.cpp`, we were previously relying on left-to-right sequential usage of the sampled slots to determine whether an allocation was sampled. We then had no method to determine whether an allocation was not sampled, as the system allocator may place the unsampled allocation in the page directly after the guarded pool, leading us to spurious failure.
> > 
> Can we just write unit tests, like we have in Google3 and Chrome GWP-ASans, Scudo, and every sanitizer?  Then we don't need these interfaces.
That is the way to go, I suggested this approach at first forgetting that there are non-lit tests.


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