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

Issue 2639483003: Avoid leaving dangling pointers to User in ProfileHelper. (Closed)

Created:
3 years, 11 months ago by Shuhei Takahashi
Modified:
3 years, 11 months ago
Reviewers:
hidehiko
CC:
chromium-reviews, elijahtaylor+arcwatch_chromium.org, yusukes+watch_chromium.org, hidehiko+watch_chromium.org, lhchavez+watch_chromium.org, oshima+watch_chromium.org, davemoore+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Avoid leaving dangling pointers to User in ProfileHelper. FakeChromeUserManager::AddUser() calls ProfileHelper::SetProfileToUserMappingForTesting() to inject a new user to ProfileHelper. However, FakeChromeUserManager does not remove the added users from ProfileHelper unless we explicitly call FakeChromeUserManager::RemoveUserFromList(), which ends up leaving dangling pointers in ProfileHelper.user_list_for_testing_. This caused use-after-free in crrev.com/2638713002 because ProfileHelper::GetUserByProfile() is called in VolumeManager::Shutdown() after a FakeChromeUserManager is destructed. BUG=chromium:681752 TEST=browser_tests --gtest_filter='ArcSessionManagerTest.*' # with ASAN Review-Url: https://codereview.chromium.org/2639483003 Cr-Commit-Position: refs/heads/master@{#443993} Committed: https://chromium.googlesource.com/chromium/src/+/acfaa8216d01efc4da558881290577e79b4c950b

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -1 line) Patch
M chrome/browser/chromeos/arc/arc_session_manager_browsertest.cc View 3 chunks +9 lines, -1 line 0 comments Download

Messages

Total messages: 16 (12 generated)
Shuhei Takahashi
hidehiko: PTAL
3 years, 11 months ago (2017-01-17 06:31:34 UTC) #9
hidehiko
LGTM. Thank you for investigation!
3 years, 11 months ago (2017-01-17 06:39:45 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/2639483003/1
3 years, 11 months ago (2017-01-17 06:47:37 UTC) #13
commit-bot: I haz the power
3 years, 11 months ago (2017-01-17 06:52:08 UTC) #16
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://chromium.googlesource.com/chromium/src/+/acfaa8216d01efc4da5588812905...

Powered by Google App Engine
This is Rietveld 408576698