Chromium Code Reviews
Descriptioncros: 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 #Messages
Total messages: 27 (21 generated)
|