[libc-commits] [PATCH] D106919: [libc][wip] add integration tests for scudo in libc

Mitch Phillips via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Aug 3 14:56:29 PDT 2021


hctim added a comment.

In D106919#2923663 <https://reviews.llvm.org/D106919#2923663>, @michaelrj wrote:

> I added a file copied from `use_after_free.cpp` but it's not crashing like it's supposed to, which to me means that something might be wrong with the gwp-asan include? I will investigate it further.

Yeah, sorry, the bad access should be done in a loop or with `GWP_ASAN_OPTIONS=SampleRate=1`, i.e.

  int main() {
    for (unsigned i = 0; i < 0x10000; ++i) {
      char *Ptr = reinterpret_cast<char *>(malloc(10));
  
      for (unsigned i = 0; i < 10; ++i) {
        *(Ptr + i) = 0x0;
      }
  
      free(Ptr);
      volatile char x = *Ptr;
    }
    return x;
  }

I should've made that more clear.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106919/new/

https://reviews.llvm.org/D106919



More information about the libc-commits mailing list