Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(766)

Issue 2365553002: Fix a use-after-free in WebsiteSettings::OnUIClosing. (Closed)

Created:
4 years, 2 months ago by dominickn
Modified:
4 years, 2 months ago
Reviewers:
felt
CC:
chromium-reviews, markusheintz_, msramek+watch_chromium.org, raymes+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix a use-after-free in WebsiteSettings::OnUIClosing. This CL makes WebsiteSettings a WebContentsObserver, fixing a use-after-free/race at browser shutdown. The exploit triggers when UI destruction occurs after the WebContents that WebsiteSettings holds a pointer to has been freed by the TabStripModel, triggering a deref of the now invalid pointer. WebsiteSettings now uses its inherited web_contents() method, which will return a nullptr after the contents is freed. This prevents the use-after-free. BUG=640571 Committed: https://crrev.com/bdd53b5fbfbbb32d6ec8e5d8107040f3fa779868 Cr-Commit-Position: refs/heads/master@{#421408}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -11 lines) Patch
M chrome/browser/ui/website_settings/website_settings.h View 3 chunks +3 lines, -6 lines 0 comments Download
M chrome/browser/ui/website_settings/website_settings.cc View 2 chunks +3 lines, -5 lines 0 comments Download

Messages

Total messages: 16 (10 generated)
dominickn
Hi felt, PTAL thanks!
4 years, 2 months ago (2016-09-22 08:31:46 UTC) #6
felt
lgtm - assuming there are no issues with Android (I notice some of the code ...
4 years, 2 months ago (2016-09-27 11:39:20 UTC) #9
dominickn
On 2016/09/27 11:39:20, felt wrote: > lgtm - assuming there are no issues with Android ...
4 years, 2 months ago (2016-09-27 12:14:59 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2365553002/1
4 years, 2 months ago (2016-09-28 00:17:28 UTC) #12
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 2 months ago (2016-09-28 01:08:34 UTC) #14
commit-bot: I haz the power
4 years, 2 months ago (2016-09-28 01:09:56 UTC) #16
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/bdd53b5fbfbbb32d6ec8e5d8107040f3fa779868
Cr-Commit-Position: refs/heads/master@{#421408}

Powered by Google App Engine
This is Rietveld 408576698