• Vlad Tsyrklevich's avatar
    GWP-ASan: Add debug allocator · 53fd1291
    Vlad Tsyrklevich authored
    This allocator is adapted from the GuardedPageAllocator in tcmalloc.
    The allocator is intended to be a 'debug' allocator to help catch memory
    errors like buffer overflows and use-after-frees. It does so by giving
    allocations an entire page and left- or right- aligning them between
    guard pages (to catch both underflows and overflows). It also sets pages
    inaccessible once they have been freed to detect use-after-frees and can
    also detect double frees.
    
    Forthcoming changes add an allocator shim to sample allocations to this
    allocator and to add additional debugging context when crashes due to
    GWP-ASan occur.
    
    GWP-ASan is going to be launched on Windows first; however, if it’s
    successful it will be ported to other platforms (and therefore also be
    used by different embedders.)
    
    Bug: 896019
    Change-Id: I358e1b6f91569d1d448fc7ee16d5df27ed2467aa
    Reviewed-on: https://chromium-review.googlesource.com/c/1284699
    Commit-Queue: Vlad Tsyrklevich <vtsyrklevich@chromium.org>
    Commit-Queue: Vitaly Buka <vitalybuka@chromium.org>
    Reviewed-by: default avatarCait Phillips <caitkp@chromium.org>
    Reviewed-by: default avatarAlbert J. Wong <ajwong@chromium.org>
    Reviewed-by: default avatarVitaly Buka <vitalybuka@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#603616}
    53fd1291
guarded_page_allocator.h 7.04 KB