Fix race between resolved promise construction and cross thread destruction
When a refcounted object is constructed, it's refcount is initally zero. This is a problem if the constructor can post a task to another thread bacause the scoped_refptr destructor on the other thread might run before the posting thread has had a chance to increment the refcount. This results in a UAF on the posting thread. The work around is to ensure the refcount is not zero before posting. Bug: 966964, 906125 Change-Id: Idf3163f979a49abe39088f5af72e94dee4492833 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1628758 Commit-Queue: Alex Clarke <alexclarke@chromium.org> Reviewed-by:François Doray <fdoray@chromium.org> Cr-Commit-Position: refs/heads/master@{#664715}
Showing
Please register or sign in to comment