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

Issue 2779973007: cros: Fix flaky owner detection (Closed)

Created:
3 years, 8 months ago by xiyuan
Modified:
3 years, 8 months ago
Reviewers:
achuithb
CC:
chromium-reviews, alemate+watch_chromium.org, achuith+watch_chromium.org, oshima+watch_chromium.org, davemoore+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

cros: Fix flaky owner detection When owner key is generated for a consumer owner, OwnerKeySet is called on both DeviceSettingsService and OwnerSettingsServiceChromeOS. Code that watches for ownership signal from DeviceSettingsService (either as an observer or via NOTIFICATION_OWNERSHIP_STATUS_CHANGED) also expects that the private part of the owner is available at the time the signal is generated. However, the private key loading in OwnerSettingsServiceChromeOS is independent of load operations in DeviceSettingsService. The private key may or may not be loaded when a load operation finishes. The CL adds an explicit flag about whether a consumer ownership is going to be established. When the flag is set, DeviceSettingsService defers all loads until InitOwner is called, which happens when the private key is loaded. Another problem is that a bool flag |is_current_user_owner_| is used but it is not updated when switching active user. This causes incorrect value returned for IsCurrentUserOwner call. The CL fixes the problems by replacing the bool flag with comparing active user AccountId with owner AccountId. Security is not reduced because the owner account id is part of the signed policy blob and only set to UserManager after policy blob is validated. BUG=702308, 706820 TEST=DeviceSettingsServiceTest.LoadDeferredDuringOwnershipEastablishment Review-Url: https://codereview.chromium.org/2779973007 Cr-Commit-Position: refs/heads/master@{#461835} Committed: https://chromium.googlesource.com/chromium/src/+/c8310bb706ce377ab64aac321f6e8f286826b360

Patch Set 1 #

Patch Set 2 : fix race between flip ownership status and private key load #

Patch Set 3 : remove unnecessary STORE_KEY_UNAVAILABLE -> TEMPORARILY_UNTRUSTED, use ownershipstatus for better readability, add a test #

Patch Set 4 : rebase #

Total comments: 3

Patch Set 5 : add comment and fix typo #

Unified diffs Side-by-side diffs Delta from patch set Stats (+92 lines, -36 lines) Patch
M chrome/browser/chromeos/login/existing_user_controller.cc View 1 2 3 2 chunks +12 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/login/users/chrome_user_manager_impl.h View 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc View 2 chunks +0 lines, -9 lines 0 comments Download
M chrome/browser/chromeos/settings/device_settings_service.h View 1 2 2 chunks +9 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/settings/device_settings_service.cc View 1 2 4 chunks +16 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/settings/device_settings_service_unittest.cc View 1 2 3 4 1 chunk +50 lines, -0 lines 0 comments Download
M components/user_manager/user_manager_base.h View 2 chunks +0 lines, -7 lines 0 comments Download
M components/user_manager/user_manager_base.cc View 4 chunks +5 lines, -12 lines 0 comments Download

Messages

Total messages: 27 (21 generated)
xiyuan
https://codereview.chromium.org/2779973007/diff/60001/components/user_manager/user_manager_base.h File components/user_manager/user_manager_base.h (left): https://codereview.chromium.org/2779973007/diff/60001/components/user_manager/user_manager_base.h#oldcode351 components/user_manager/user_manager_base.h:351: mutable base::Lock is_current_user_owner_lock_; The comment and the lock is ...
3 years, 8 months ago (2017-04-03 19:02:56 UTC) #15
achuithb
lgtm with nits https://codereview.chromium.org/2779973007/diff/60001/chrome/browser/chromeos/settings/device_settings_service_unittest.cc File chrome/browser/chromeos/settings/device_settings_service_unittest.cc (right): https://codereview.chromium.org/2779973007/diff/60001/chrome/browser/chromeos/settings/device_settings_service_unittest.cc#newcode461 chrome/browser/chromeos/settings/device_settings_service_unittest.cc:461: TEST_F(DeviceSettingsServiceTest, LoadDeferredDuringOwnershipEastablishment) { Please add a ...
3 years, 8 months ago (2017-04-04 19:38:34 UTC) #19
achuithb
The commentary in the description is very useful - it would be nice to have ...
3 years, 8 months ago (2017-04-04 19:39:57 UTC) #20
xiyuan
https://codereview.chromium.org/2779973007/diff/60001/chrome/browser/chromeos/settings/device_settings_service_unittest.cc File chrome/browser/chromeos/settings/device_settings_service_unittest.cc (right): https://codereview.chromium.org/2779973007/diff/60001/chrome/browser/chromeos/settings/device_settings_service_unittest.cc#newcode461 chrome/browser/chromeos/settings/device_settings_service_unittest.cc:461: TEST_F(DeviceSettingsServiceTest, LoadDeferredDuringOwnershipEastablishment) { On 2017/04/04 19:38:34, achuithb wrote: > ...
3 years, 8 months ago (2017-04-04 20:17:51 UTC) #21
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/2779973007/80001
3 years, 8 months ago (2017-04-04 20:19:56 UTC) #24
commit-bot: I haz the power
3 years, 8 months ago (2017-04-04 21:06:38 UTC) #27
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://chromium.googlesource.com/chromium/src/+/c8310bb706ce377ab64aac321f6e...

Powered by Google App Engine
This is Rietveld 408576698