• Vlad Tsyrklevich's avatar
    allocator shim: Add windows _msize interception · 4f379f24
    Vlad Tsyrklevich authored
    Currently, the Windows allocator shims do not hook _msize() causing
    sporadic crashes when GWP-ASan is enabled. This occurs because sqlite3
    uses _msize() and the native implementation does not properly handle
    allocations not returned by the native allocator.
    
    Furthermore, the current (unused) implementation of
    WinHeapGetSizeEstimate() seems to be an artifact of the original
    implementation from crrev.com/2163783003. It incorrectly increases the
    size estimate returned by the native allocator, which can cause
    exceptions in sqlite3 (there are routines that will read the _msize of
    an allocation and assume the returned size forms a safe bound.) I
    changed this routine to just return the allocation size returned by the
    native allocator.
    
    Bug: 909720
    Change-Id: Ie8975053992161cdc3e447f75733345f0a142978
    Reviewed-on: https://chromium-review.googlesource.com/c/1354219
    Commit-Queue: Vlad Tsyrklevich <vtsyrklevich@chromium.org>
    Reviewed-by: default avatarPrimiano Tucci <primiano@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#612051}
    4f379f24
winheap_stubs_win.cc 1.88 KB