forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix potential use-after-free/race condition in AmbientPhotoCache.
The old API was accepting a raw pointer to a protobuf message and modifying the object asynchronously on a worker thread. We don't know for sure that this is the exact reason for the crash, but this API can be a problem if a) the protobuf message is destroyed before the worker thread writes to it (i.e. the ambient-mode enabled pref changes) b) AmbientPhotoController modifies the protobuf message concurrently on the UI thread. Both seem extremely unlikely, but this is a low volume crash that's been around since M98 so maybe it's happening on a few devices. Since this is the only visible explanation for a crash like this and it seems like an overall improvement to the API, we'll make this change and see if the crash goes away. Bug: b:240194606 Change-Id: Icc47b78702e67e6a52be9b99fe49be6ea7681dd1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3786842 Commit-Queue: Eric Sum <esum@google.com> Reviewed-by: Xiaohui Chen <xiaohuic@chromium.org> Cr-Commit-Position: refs/heads/main@{#1028513}
- Loading branch information
Showing
6 changed files
with
46 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters