canvas2d: Fix UAF due to undefined destruction order for TLS.
CanvasResourceSharedImage::OnBitmapImageDestroyed can be triggered when the shared context stored in thread local storage is desroyed. The function uses Thread::Current() for checking which thread it is invoked on. Since Thread is also stored in TLS and there is no clear order in which TLS objects are destroyed, this can result in UAF if Thread is destroyed before the context. Avoid the above by using PlatformThreadId which uses low level platform APIs to get a unique thread id. R=kbr@chromium.org Bug: 984788 Change-Id: Ifb73fdf5fa07d9de8afbbf0aea876d3b30cbcea3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1709891 Commit-Queue: Khushal <khushalsagar@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org> Auto-Submit: Khushal <khushalsagar@chromium.org> Reviewed-by:Kenneth Russell <kbr@chromium.org> Cr-Commit-Position: refs/heads/master@{#678960}
Showing
Please register or sign in to comment