-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
M72: service worker: Make LevelDB database outlive its iterator to fi…
…x crash. As explained in the bug by pwnall: ServiceWorkerDatabase::GetRegistrationsForOrigin() obtains a LevelDB iterator and calls ServiceWorkerDatabase::ReadResourceRecords() in a loop. ReadResourceRecords() in turn calls ServiceWorkerDatabase::HandleReadResult(), which may call ServiceWorkerDatabase::Disable() if the status is a failure. Disable() contains a "db_.reset()" which deletes the leveldb::DB instance. So, ReadResourceRecords() may end up deleting the database before the iterator used by GetRegistrationsForOrigin() is deleted. The contract for leveldb::DB::NewIterator() [1] states that the iterator must be deleted before the DB instance is deleted. [1] https://cs.chromium.org/chromium/src/third_party/leveldatabase/src/include/leveldb/db.h?l=92&rcl=73d5834eceee8efa9a8ccfec77dc096a9e8ba18a Bug: 909024 Change-Id: Ifee9aa0f7e1db9168d61b6407a11e249b2001986 Reviewed-on: https://chromium-review.googlesource.com/c/1354730 Commit-Queue: Matt Falkenhagen <[email protected]> Reviewed-by: Hiroki Nakagawa <[email protected]> Reviewed-by: Victor Costan <[email protected]> Cr-Original-Commit-Position: refs/heads/master@{#612599}(cherry picked from commit dd5d624) Reviewed-on: https://chromium-review.googlesource.com/c/1362673 Reviewed-by: Matt Falkenhagen <[email protected]> Cr-Commit-Position: refs/branch-heads/3626@{#65} Cr-Branched-From: d897fb1-refs/heads/master@{#612437}
- Loading branch information
Showing
2 changed files
with
86 additions
and
10 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