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

Issue 2567973002: Mac: Fix lifetime problem under BookmarkBarController stopPulsingBookmarkNode. (Closed)

Created:
4 years ago by tapted
Modified:
4 years ago
Reviewers:
Robert Sesek
CC:
chromium-reviews, tfarina, mac-reviews_chromium.org, chrome-apps-syd-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Mac: Fix lifetime problem under BookmarkBarController stopPulsingBookmarkNode. BookmarkBarController has a weak pointer in a |pulsingButton_| data member. This is an NSView which can be destroyed in -[BookmarkBarController redistributeButtonsOnBarAsNeeded] when it is removed from its superview. Since bubbles close asynchronously, and fade out, the bookmark bubble can cause a UAF to |pulsingButton_| via stopPulsingBookmarkNode. This can occur if a resize triggers redistributeButtonsOnBarAsNeeded while a bookmark bubble is still alive. There's no need for this to be a weak pointer. Make it scoped_nsobject instead. This affects both Cocoa and MacViews. BUG=616051 TEST=Added unit_test: BookmarkBarControllerTest.RedistributeButtonsOnBarAsNeeded Committed: https://crrev.com/561b5ae646d076efe21e2cc759b6d97ebb04ab0d Cr-Commit-Position: refs/heads/master@{#437954}

Patch Set 1 #

Patch Set 2 : Guarantee a crash #

Unified diffs Side-by-side diffs Delta from patch set Stats (+47 lines, -6 lines) Patch
M chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h View 1 chunk +4 lines, -4 lines 0 comments Download
M chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm View 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm View 1 1 chunk +40 lines, -0 lines 0 comments Download

Messages

Total messages: 19 (14 generated)
tapted
Hi Robert, please take a look
4 years ago (2016-12-12 05:32:46 UTC) #11
Robert Sesek
LGTM
4 years ago (2016-12-12 18:05:27 UTC) #12
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/2567973002/20001
4 years ago (2016-12-12 22:43:46 UTC) #14
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years ago (2016-12-12 23:25:40 UTC) #17
commit-bot: I haz the power
4 years ago (2016-12-12 23:29:06 UTC) #19
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/561b5ae646d076efe21e2cc759b6d97ebb04ab0d
Cr-Commit-Position: refs/heads/master@{#437954}

Powered by Google App Engine
This is Rietveld 408576698