Make CanvasAsyncBlobCreator persist through RecordIdentifiabilityMetric
RecordIdentifiabilityMetric used a lambda callback this function and it was not immediately clear that CanvasAsyncBlobCreator could get garbage collected before the callback was run. The garbage collection would free image_ and result in a UAF. Now the callback is in a separate function and the caller is bound to be persistent, matching the pattern of other callback functions in this class. The dispose method also needs to be moved. Prior to this change it was always called before the RecordIdentifiabilityMetric finished. It worked because the callback kept a pointer to the image, that had already been destroyed, a bit of a Mr Burns situation: https://www.youtube.com/watch?v=aI0euMFAWF8 Bug: 1137104 Change-Id: Iccfaf9cc15352ee3b002dad1e4241c0683fbc8bb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2505460Reviewed-by:Philip Jägenstedt <foolip@chromium.org> Reviewed-by:
Juanmi Huertas <juanmihd@chromium.org> Reviewed-by:
Yi Xu <yiyix@chromium.org> Commit-Queue: Aaron Krajeski <aaronhk@chromium.org> Cr-Commit-Position: refs/heads/master@{#823850}
Showing
Please register or sign in to comment