FakeChromeUserManager leaves dangling pointers in ProfileHelper if added users are not explicitly removed |
||
Issue descriptionFakeChromeUserManager::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_. Actually this behavior caused use-after-free in crrev.com/2638713002 because ProfileHelper::GetUserByProfile() is called in VolumeManager::Shutdown() after a FakeChromeUserManager is destructed. Existing tests often call AddUser() without cleaning up with RemoveUserFromList(), so dangling pointers are possibly there without being realized.
,
Jan 17 2017
#1 fixed use-after-free in ArcSessionManagerTest by calling RemoveUserFromList() explicitly, but I guess we want to resolve possible bugs by either: 1. automatically unregister users from ProfileHelper in the destructor of FakeChromeUserManager, or 2. insert DCHECK in the destructor of FakeChromeUserManager to catch the case where RemoveUserFromList() is not called explicitly.
,
Jan 10
Archiving P3s older than 1 year with no owner or component. |
||
►
Sign in to add a comment |
||
Comment 1 by bugdroid1@chromium.org
, Jan 17 2017