OSDN Git Service

android-x86/system-vold.git
3 years agoMerge "Set a default ACL on /data/media/userId."
Treehugger Robot [Tue, 2 Mar 2021 09:25:52 +0000 (09:25 +0000)]
Merge "Set a default ACL on /data/media/userId."

3 years agoMerge "[vold] expose binder headers to dependent modules"
Treehugger Robot [Fri, 26 Feb 2021 03:35:10 +0000 (03:35 +0000)]
Merge "[vold] expose binder headers to dependent modules"

3 years ago[vold] expose binder headers to dependent modules
Songchun Fan [Thu, 25 Feb 2021 23:16:11 +0000 (23:16 +0000)]
[vold] expose binder headers to dependent modules

This allows libincremental_aidl-cpp to be built via cc_library instead
of aidl_interface.

BUG: 181266844
Test: builds
Change-Id: I4f0bc82629c0df758467aa074274b30f9dc6718d

3 years agoMerge "vold: Use Wakelock::tryGet()"
Kalesh Singh [Wed, 24 Feb 2021 18:49:58 +0000 (18:49 +0000)]
Merge "vold: Use Wakelock::tryGet()"

3 years agoSet a default ACL on /data/media/userId.
Martijn Coenen [Mon, 1 Feb 2021 07:57:02 +0000 (07:57 +0000)]
Set a default ACL on /data/media/userId.

This directory is used as a root for external storage on adopted storage
devices. It needs to be writable by processes holding the AID_MEDIA_RW
GID permission; in particular, it should be writable by the FUSE daemon.

On devices with sdcardfs, this was ensured automatically, because
sdcardfs presented a view of this directory that was writable, that we
could use for the FUSE daemon. But on devices without sdcardfs, the FUSE
daemon sees the raw filesystem and its permissions. This also means that
files created by the FUSE daemon will have their uid/gid set to the uid
of the FUSE daemon; to ensure these files stay writable to other system
applications that have AID_MEDIA_RW, use a default ACL to make sure the
gid stays AID_MEDIA_RW.

In particular, this fixes an issue with app cloning, where we want the
FUSE daemon of user 0 to be able to access the files of the app clone
user, and vice versa.

Bug: 154057120
Test: inspect uid/gid of /data/media/0 and contents
Change-Id: Ic5d63457ec917ea407b900dbb7773d89311780c6

3 years agovold: Use Wakelock::tryGet()
Kalesh Singh [Mon, 22 Feb 2021 20:10:45 +0000 (15:10 -0500)]
vold: Use Wakelock::tryGet()

Acquiring a wakelock can fail if the suspend service is unavailable.
Explicitly check that wakelock was acquired before performing
operations that require the device to stay on.

Bug: b/179229598
Test: Boot test on Pixel 4 device
Change-Id: If30087223e44098801a31d1bfd239ac22e891abe

3 years agoMerge changes from topic "fsync-fixes"
Treehugger Robot [Fri, 19 Feb 2021 19:23:47 +0000 (19:23 +0000)]
Merge changes from topic "fsync-fixes"

* changes:
  Add syncs when creating parent directories
  Sync parent directory in storeKeyAtomically()
  Move pathExists() to Utils.cpp

3 years agoMerge "Revert "Revert "Revert "Set a default ACL on /data/media/userId.""""
Dhiraj Jadhav [Thu, 18 Feb 2021 17:38:20 +0000 (17:38 +0000)]
Merge "Revert "Revert "Revert "Set a default ACL on /data/media/userId.""""

3 years agoRevert "Revert "Revert "Set a default ACL on /data/media/userId."""
Dhiraj Jadhav [Thu, 18 Feb 2021 04:57:03 +0000 (04:57 +0000)]
Revert "Revert "Revert "Set a default ACL on /data/media/userId."""

This reverts commit ea9681e4cdf30340b583dc27cb6c6474926ddaee.

Reason for revert: storage Permission causing b/179362637 adb push to fail

Change-Id: Ibc1d8b5b685c22545b7e2d15de58059960b87e14

3 years agoAdd syncs when creating parent directories
Eric Biggers [Tue, 16 Feb 2021 23:59:17 +0000 (15:59 -0800)]
Add syncs when creating parent directories

vold creates some directories for storing encryption keys if they don't
already exist, potentially including parent directories:

    /metadata/vold/metadata_encryption
    /data/misc/vold/volume_keys/$volume_uuid
    /data/misc_de/$user/vold/volume_keys/$volume_uuid
    /data/misc_ce/$user/vold/volume_keys/$volume_uuid

Currently fs_mkdirs() is used for this.  However, fs_mkdirs() doesn't
include the fsync()s of the parent directories that are needed to ensure
that the new directories are persisted to disk right away -- which is
important for encryption keys.

Add a utility function MkdirsSync() which does what is needed, and make
the appropriate places call it.

Test: Booted and checked log for "Created directory" message.
      Also ran 'atest vold_tests' to run the new unit test.
Change-Id: Ie9917b616433080139b8db3fd6877203ee6faf77

3 years agoSync parent directory in storeKeyAtomically()
Eric Biggers [Tue, 16 Feb 2021 23:59:17 +0000 (15:59 -0800)]
Sync parent directory in storeKeyAtomically()

When an FBE or metadata encryption key is created, it's important that
it be persisted to disk right away; otherwise the device may fail to
boot after an unclean shutdown.  storeKey() has the needed fsync()s.
However, storeKeyAtomically() doesn't, as it doesn't fsync() the parent
directory of key_path after it renames tmp_path to it.

Two callers do fsync() the parent directory themselves, but others
don't.  E.g., the metadata encryption key doesn't get properly synced.

Therefore, add the needed fsync() to storeKeyAtomically() so that it
gets done for everyone.

Also remove the now-unneeded fsync()s from the two callers that did it
themselves.

Change-Id: I342ebd94f0a3d2bf3a7a443c35b6bda0f12e1ab2

3 years agoMove pathExists() to Utils.cpp
Eric Biggers [Tue, 16 Feb 2021 23:59:17 +0000 (15:59 -0800)]
Move pathExists() to Utils.cpp

This is useful as a general utility function.

Change-Id: Id43fc106dc6c544c6e4ce65f10c7d4246b99e54a

3 years agoMerge "[LSC] Add LOCAL_LICENSE_KINDS to system/vold"
Treehugger Robot [Mon, 15 Feb 2021 23:21:47 +0000 (23:21 +0000)]
Merge "[LSC] Add LOCAL_LICENSE_KINDS to system/vold"

3 years ago[LSC] Add LOCAL_LICENSE_KINDS to system/vold
Bob Badour [Fri, 12 Feb 2021 22:24:10 +0000 (14:24 -0800)]
[LSC] Add LOCAL_LICENSE_KINDS to system/vold

Added SPDX-license-identifier-Apache-2.0 to:
  Android.bp
  bench/inodeop_bench/Android.bp
  tests/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I91823c7097d7bee39a363a0c0cc30de13e4d7539

3 years agoMerge "Obtain incfs features early in the booting sequence."
Treehugger Robot [Sat, 13 Feb 2021 06:32:14 +0000 (06:32 +0000)]
Merge "Obtain incfs features early in the booting sequence."

3 years agoObtain incfs features early in the booting sequence.
Alex Buynytskyy [Fri, 12 Feb 2021 03:09:10 +0000 (19:09 -0800)]
Obtain incfs features early in the booting sequence.

Has to be done before SystemConfig initialization to set correct
Incremental version feature.

Bug: 180010901
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest
Change-Id: I262d1f06aecb481f37bf82005c85fed02c476510

3 years agoMerge "Revert "Revert "Set a default ACL on /data/media/userId."""
Martijn Coenen [Mon, 1 Feb 2021 13:30:04 +0000 (13:30 +0000)]
Merge "Revert "Revert "Set a default ACL on /data/media/userId."""

3 years agoRevert "Revert "Set a default ACL on /data/media/userId.""
Martijn Coenen [Mon, 1 Feb 2021 07:57:02 +0000 (07:57 +0000)]
Revert "Revert "Set a default ACL on /data/media/userId.""

This reverts commit b276e80aec54c139587bbc510f503ced9414cf0f.

Reason for revert: b/177926359 is now fixed

Change-Id: I8ec5d80a44fc9e491ab3430592e17d10a82f40ea

3 years agoMerge "Add support for binding storage encryption to a seed"
Seth Moore [Wed, 27 Jan 2021 00:40:35 +0000 (00:40 +0000)]
Merge "Add support for binding storage encryption to a seed"

3 years agoMerge "Specify version for aidl_interface explicitly"
Treehugger Robot [Tue, 26 Jan 2021 22:28:23 +0000 (22:28 +0000)]
Merge "Specify version for aidl_interface explicitly"

3 years agoAdd support for binding storage encryption to a seed
Seth Moore [Tue, 19 Jan 2021 17:51:51 +0000 (17:51 +0000)]
Add support for binding storage encryption to a seed

With this change, vold exposes an API that may be used to bind key
storage encryption keys to a given seed value. The seed value passed to
vold must be consistent across reboots, or key storage keys will not be
derived consistently. The seed is expected to be set very early in boot,
prior to the use of any key storage encryption keys.

This feature is intended to be used for embedded applications such as
in autos, where the seed may be provided by some other component of the
system. In such systems, there is a default user that is automatically
signed in without a PIN or other credentials. By binding the file
encryption to a platform-provided seed, the default user's data gains
additional protection against removal of the Android embedded device
from the integrated system.

Bug: 157501579
Test: Set seed at startup via init.rc. Seed changes fail as expected.
Change-Id: I9b048ec5e045b84c45883724ace2356d4ef6244d

3 years agoSpecify version for aidl_interface explicitly
Jeongik Cha [Tue, 26 Jan 2021 13:35:14 +0000 (22:35 +0900)]
Specify version for aidl_interface explicitly

Bug: 150578172
Test: m
Change-Id: Ie51caa503b6b1e5c29372b85d0357be292144126

3 years agoMerge "Revert "Set a default ACL on /data/media/userId.""
Martijn Coenen [Thu, 21 Jan 2021 08:19:20 +0000 (08:19 +0000)]
Merge "Revert "Set a default ACL on /data/media/userId.""

3 years agoMerge changes from topic "health_storage_aidl"
Yifan Hong [Wed, 20 Jan 2021 19:45:16 +0000 (19:45 +0000)]
Merge changes from topic "health_storage_aidl"

* changes:
  Use AIDL HAL for Dev GC
  Refactor HIDL HAL Dev GC invocation

3 years agoRevert "Set a default ACL on /data/media/userId."
Martijn Coenen [Wed, 20 Jan 2021 15:51:44 +0000 (15:51 +0000)]
Revert "Set a default ACL on /data/media/userId."

This reverts commit a71323ec0ea0927464c7e6f62770ef43f649b3fb.

Reason for revert: b/177926359 - note that this is a Google testing infrastructure issue, and no issue with this patch. Partners can keep using this patch. It will be resubmitted in a few weeks.

Change-Id: Ia13279ac1aafa2e4425c4527aeadd5d0fadbc2e4

3 years agoMerge "Revert^4 "Customize StubVolume implementation for ARC""
Treehugger Robot [Wed, 20 Jan 2021 10:33:52 +0000 (10:33 +0000)]
Merge "Revert^4 "Customize StubVolume implementation for ARC""

3 years agoRevert^4 "Customize StubVolume implementation for ARC"
Risan [Wed, 20 Jan 2021 05:53:15 +0000 (05:53 +0000)]
Revert^4 "Customize StubVolume implementation for ARC"

This reverts commit 8ed81fd9ca4e58231e71a5c59c839d7ba5ca4b3f.

Reason for revert: Let me try one last time more carefully. According to https://googleplex-android-review.git.corp.google.com/q/%2522customize+stubvolume%2522 - this CL will flow to aosp branches (without vendor images) and 2 branches with vendor images. I have submitted the vendor CL for both branches now (ag/13366009 and ag/13371672). This should not break anything now.

Change-Id: I69aacceabfb70053387a3c156b49e06be65fe6e4

3 years agoMerge "Revert "Revert "Revert "Customize StubVolume implementation for ARC""""
Maurice Lam [Tue, 19 Jan 2021 19:28:36 +0000 (19:28 +0000)]
Merge "Revert "Revert "Revert "Customize StubVolume implementation for ARC""""

3 years agoRevert "Revert "Revert "Customize StubVolume implementation for ARC"""
Maurice Lam [Tue, 19 Jan 2021 19:03:56 +0000 (19:03 +0000)]
Revert "Revert "Revert "Customize StubVolume implementation for ARC"""

This reverts commit 3164c0a2385c9e27f21a6de346de15216d652ec7.

Reason for revert: b/177917240

Change-Id: I69f541698a3068d59553d555846ba45d169fbbed

3 years agoMerge "Call setupAppDir before EnsureDirExists"
rickywai [Tue, 19 Jan 2021 15:24:02 +0000 (15:24 +0000)]
Merge "Call setupAppDir before EnsureDirExists"

3 years agoCall setupAppDir before EnsureDirExists
Ricky Wai [Tue, 19 Jan 2021 11:27:36 +0000 (11:27 +0000)]
Call setupAppDir before EnsureDirExists

So we can ensure Android/ dir is created,
otherwise EnsureDirExists may return false if Android/ doesn't exist

Bug: 177281374
Test: Able to boot without errors
Change-Id: I02e816b60530ac9d3d3b978a7c9028d2c0e34bad

3 years agoMerge "Revert "Revert "Customize StubVolume implementation for ARC"""
Risan [Tue, 19 Jan 2021 11:20:08 +0000 (11:20 +0000)]
Merge "Revert "Revert "Customize StubVolume implementation for ARC"""

3 years agoMerge "Set a default ACL on /data/media/userId."
Martijn Coenen [Tue, 19 Jan 2021 09:38:55 +0000 (09:38 +0000)]
Merge "Set a default ACL on /data/media/userId."

3 years agoRevert "Revert "Customize StubVolume implementation for ARC""
Risan [Tue, 19 Jan 2021 02:24:38 +0000 (02:24 +0000)]
Revert "Revert "Customize StubVolume implementation for ARC""

This reverts commit 0cf77b025dd7e9fd92ddf3259de800c19e5db73d.

Reason for revert: The requird libarcvolume has been submitted to master (ag/13366009)

Change-Id: I86fada53aad2ec5faa497a9bcbce5435c35d040e

3 years agoMerge "Revert "Customize StubVolume implementation for ARC""
Mariia Sandrikova [Mon, 18 Jan 2021 18:00:07 +0000 (18:00 +0000)]
Merge "Revert "Customize StubVolume implementation for ARC""

3 years agoMerge "Add a method in vold to unmount app data and obb dir for testing"
Treehugger Robot [Mon, 18 Jan 2021 16:20:41 +0000 (16:20 +0000)]
Merge "Add a method in vold to unmount app data and obb dir for testing"

3 years agoRevert "Customize StubVolume implementation for ARC"
Mariia Sandrikova [Mon, 18 Jan 2021 15:19:16 +0000 (15:19 +0000)]
Revert "Customize StubVolume implementation for ARC"

This reverts commit b5d7cb0a523936c79c124220b4df28e4846b0b22.

Reason for revert: Broken build b/177828900
Fix: 177829766

Change-Id: Ic2984da3b11bcf5597203b511943d3058ea9ea19

3 years agoMerge "Add kVisible flag to vold::Disk"
Treehugger Robot [Mon, 18 Jan 2021 14:54:27 +0000 (14:54 +0000)]
Merge "Add kVisible flag to vold::Disk"

3 years agoAdd a method in vold to unmount app data and obb dir for testing
Ricky Wai [Fri, 15 Jan 2021 14:03:23 +0000 (14:03 +0000)]
Add a method in vold to unmount app data and obb dir for testing

This new method will be used in new sm command.
Tests can use this so data and obb dirs are unmounted, and won't
be killed when volume is unmounted.

Bug: 148049767
Test: New sm command able to unmount app's data and obb dirs
Change-Id: Ifbc661ca510e996abd4b7ce1fb195aaa7afc37ad

3 years agoMerge "Customize StubVolume implementation for ARC"
Risan [Mon, 18 Jan 2021 12:49:36 +0000 (12:49 +0000)]
Merge "Customize StubVolume implementation for ARC"

3 years agoAdd kVisible flag to vold::Disk
Youkichi Hosoi [Tue, 7 Jul 2020 21:08:48 +0000 (06:08 +0900)]
Add kVisible flag to vold::Disk

The new flag is used to indicate that a stub volume (external storage
volume shared with Chrome OS) is visible to Android apps.

Bug: 123377807
Bug: 142684760
Bug: 132796154
Test: Check logcat logs for StorageManagerService.mount() when the
Test: visibility setting of a removable device is toggled in Chrome OS.
Test: Confirm that the visibility setting is properly set.
Test: (Tested in R)
Change-Id: Ica69110d5667837a72a5c8693ff3bccc0f09a82d

3 years agoCustomize StubVolume implementation for ARC
Risan [Mon, 28 Dec 2020 20:08:38 +0000 (05:08 +0900)]
Customize StubVolume implementation for ARC

This allow ARC to customize StubVolume implementation in vendor
partition.

Bug: 132796154
Test: Customize the implementation of StubVolume and check on device.
Ignore-AOSP-First: Will cherry-pick to AOSP.
Change-Id: I626a7ed4113b6132bb456b3258ee4a93b4f8a72e

3 years agoUse AIDL HAL for Dev GC
Yifan Hong [Thu, 14 Jan 2021 01:27:42 +0000 (17:27 -0800)]
Use AIDL HAL for Dev GC

Test: run idle maint
Bug: 177470478

Change-Id: Iefddf8628e31f020b86ff56dfb4926c2c9a2a888

3 years agoRefactor HIDL HAL Dev GC invocation
Yifan Hong [Thu, 14 Jan 2021 01:10:47 +0000 (17:10 -0800)]
Refactor HIDL HAL Dev GC invocation

Prefix all HIDL HAL types with the letter H.
Also make the invocation more generic so that we can use
the AIDL implementation in the future.

Test: TH
Bug: 177470478

Change-Id: Iee0af9727c48c532315203c138a4996a08fcaa34

3 years agoMerge "Remove persist.sys.fuse == false code paths"
rickywai [Fri, 15 Jan 2021 14:00:35 +0000 (14:00 +0000)]
Merge "Remove persist.sys.fuse == false code paths"

3 years agoRemove persist.sys.fuse == false code paths
Ricky Wai [Thu, 14 Jan 2021 15:51:54 +0000 (15:51 +0000)]
Remove persist.sys.fuse == false code paths

Since Android R, the FUSE prop is always on and FUSE-off is no longer
supported

Test: m
Bug: 160159282
Merged-In: Ic4414b850511fe3b4fc6df3f8b736d21335db820
Change-Id: I5a7643f9ca2f37cd7f264331df76b42df31988d5

3 years agoMerge "Remove ro.vold.level_from_user."
Alan Stokes [Tue, 12 Jan 2021 11:17:50 +0000 (11:17 +0000)]
Merge "Remove ro.vold.level_from_user."

3 years agoMerge "Vold should still create obb / data dirs for sdcardfs device"
rickywai [Fri, 8 Jan 2021 13:14:57 +0000 (13:14 +0000)]
Merge "Vold should still create obb / data dirs for sdcardfs device"

3 years agoVold should still create obb / data dirs for sdcardfs device
Ricky Wai [Thu, 7 Jan 2021 09:57:44 +0000 (09:57 +0000)]
Vold should still create obb / data dirs for sdcardfs device

Otherwise, zygote can't find those dirs and bind mount them.

Bug: 176959830
Test: atest AdoptableHostTest
Change-Id: Ib8a7616f8e248fed244d4f23d3ae36b1419a732d

3 years agoMerge "Let vold format the encrypted partition"
Jaegeuk Kim [Wed, 6 Jan 2021 19:12:35 +0000 (19:12 +0000)]
Merge "Let vold format the encrypted partition"

3 years agoRemove ro.vold.level_from_user.
Alan Stokes [Tue, 22 Dec 2020 14:49:18 +0000 (14:49 +0000)]
Remove ro.vold.level_from_user.

This is on everywhere, we no longer have any need for it.

Fix: 171462631
Test: Presubmits
Change-Id: I240361619acafeee6cac383037887e15a46c0c38

3 years agoMerge "Revert "Set a default ACL on /data/media/userId.""
Martijn Coenen [Thu, 24 Dec 2020 08:38:02 +0000 (08:38 +0000)]
Merge "Revert "Set a default ACL on /data/media/userId.""

3 years agoSet a default ACL on /data/media/userId.
Martijn Coenen [Wed, 16 Dec 2020 08:40:33 +0000 (09:40 +0100)]
Set a default ACL on /data/media/userId.

This directory is used as a root for external storage on adopted storage
devices. It needs to be writable by processes holding the AID_MEDIA_RW
GID permission; in particular, it should be writable by the FUSE daemon.

On devices with sdcardfs, this was ensured automatically, because
sdcardfs presented a view of this directory that was writable, that we
could use for the FUSE daemon. But on devices without sdcardfs, the FUSE
daemon sees the raw filesystem and its permissions. This also means that
files created by the FUSE daemon will have their uid/gid set to the uid
of the FUSE daemon; to ensure these files stay writable to other system
applications that have AID_MEDIA_RW, use a default ACL to make sure the
gid stays AID_MEDIA_RW.

In particular, this fixes an issue with app cloning, where we want the
FUSE daemon of user 0 to be able to access the files of the app clone
user, and vice versa.

Bug: 154057120
Test: inspect uid/gid of /data/media/0 and contents
Change-Id: Ib718b8362df84754ee3cac33865bca3c12df2e3a

3 years agoRevert "Set a default ACL on /data/media/userId."
Martijn Coenen [Wed, 23 Dec 2020 19:14:15 +0000 (19:14 +0000)]
Revert "Set a default ACL on /data/media/userId."

This reverts commit 8688eb4f47bd589feb2e885836b34c5991158845.

Reason for revert: Probably causing b/176240229

Change-Id: Id92d1f1589e8927f372960ec2cc5d262d10ad161

3 years agoMerge "Set a default ACL on /data/media/userId."
Martijn Coenen [Wed, 23 Dec 2020 07:56:19 +0000 (07:56 +0000)]
Merge "Set a default ACL on /data/media/userId."

3 years agoLet vold format the encrypted partition
Jaegeuk Kim [Tue, 15 Dec 2020 17:00:49 +0000 (09:00 -0800)]
Let vold format the encrypted partition

Bug: 172378121
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I03997eb4cbf25a80e36ea738c50e0adb7f4013dd

3 years agoSet a default ACL on /data/media/userId.
Martijn Coenen [Wed, 16 Dec 2020 08:40:33 +0000 (09:40 +0100)]
Set a default ACL on /data/media/userId.

This directory is used as a root for external storage on adopted storage
devices. It needs to be writable by processes holding the AID_MEDIA_RW
GID permission; in particular, it should be writable by the FUSE daemon.

On devices with sdcardfs, this was ensured automatically, because
sdcardfs presented a view of this directory that was writable, that we
could use for the FUSE daemon. But on devices without sdcardfs, the FUSE
daemon sees the raw filesystem and its permissions. This also means that
files created by the FUSE daemon will have their uid/gid set to the uid
of the FUSE daemon; to ensure these files stay writable to other system
applications that have AID_MEDIA_RW, use a default ACL to make sure the
gid stays AID_MEDIA_RW.

In particular, this fixes an issue with app cloning, where we want the
FUSE daemon of user 0 to be able to access the files of the app clone
user, and vice versa.

Bug: 154057120
Test: inspect uid/gid of /data/media/0 and contents
Change-Id: I6dfae41f9cb6a8283978b2667b02708a000f07c0

3 years agoMerge "Check if storage app data and obb directories exist in vold"
rickywai [Mon, 14 Dec 2020 14:24:36 +0000 (14:24 +0000)]
Merge "Check if storage app data and obb directories exist in vold"

3 years agoMerge "OWNERS: add alan and jeff, alphabetize"
Jeffrey Vander Stoep [Thu, 10 Dec 2020 13:59:45 +0000 (13:59 +0000)]
Merge "OWNERS: add alan and jeff, alphabetize"

3 years agoMerge "Enable improved user separation by default."
Alan Stokes [Thu, 10 Dec 2020 12:30:43 +0000 (12:30 +0000)]
Merge "Enable improved user separation by default."

3 years agoOWNERS: add alan and jeff, alphabetize
Jeff Vander Stoep [Thu, 10 Dec 2020 12:07:57 +0000 (13:07 +0100)]
OWNERS: add alan and jeff, alphabetize

Test: n/a
Change-Id: I3b9f18906b72d0a3aed712f6c6990180294d0d2b

3 years agoEnable improved user separation by default.
Alan Stokes [Thu, 10 Dec 2020 09:54:06 +0000 (09:54 +0000)]
Enable improved user separation by default.

This is already on for all Pixel devices with no problems observed.

If this causes issues with a specific device (e.g. vendor apps being
unable to access their data) it can be temporarily disabled by adding

PRODUCT_PROPERTY_OVERRIDES += ro.vold.level_from_user=0

to the device.mk file. Please file a bug if that happens.

Bug: 141677108
Test: presubmits
Change-Id: Ic9da534f1a5f4c9e3bd62ea5c09a3b11ebcb33e7
Merged-In: Ic9da534f1a5f4c9e3bd62ea5c09a3b11ebcb33e7
(cherry picked from commit 763393644a0a6e361f26dfe26f6dc0021579f011)

3 years agoCheck if storage app data and obb directories exist in vold
Ricky Wai [Thu, 3 Dec 2020 15:32:52 +0000 (15:32 +0000)]
Check if storage app data and obb directories exist in vold

As storage is not mounted in system server, we use vold
to check if storage app data and obb directories exist instead.

We add a method in vold so it only creates app data and obb dirs
if dirs do not exist to speed up app starting time.

Bug: 160336374
Test: Data and obb directories are created when a new app is started
Change-Id: I1bd784d9c9e05463f71433fc782ac4e0c831cbf1

3 years agoMerge "Follow vdc naming convention: earlyBootEnded" am: e8838a862d
Treehugger Robot [Wed, 2 Dec 2020 08:20:27 +0000 (08:20 +0000)]
Merge "Follow vdc naming convention: earlyBootEnded" am: e8838a862d

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1512480

Change-Id: I7df00e8936fd2185541645594a9633317632fe99

3 years agoMerge "Follow vdc naming convention: earlyBootEnded"
Treehugger Robot [Wed, 2 Dec 2020 07:49:38 +0000 (07:49 +0000)]
Merge "Follow vdc naming convention: earlyBootEnded"

3 years agoFollow vdc naming convention: earlyBootEnded
Paul Crowley [Tue, 1 Dec 2020 22:36:06 +0000 (14:36 -0800)]
Follow vdc naming convention: earlyBootEnded

vdc commands use camelCase, not kebab-case.

Test: EarlyBootKeyTest.CannotCreateEarlyBootKeys
Change-Id: I7be4d3008a731829e5d5e025216cb2ade238a530

3 years agoSkip rvc-qpr-dev-plus-aosp-without-vendor@6881855
Xin Li [Tue, 24 Nov 2020 00:26:04 +0000 (16:26 -0800)]
Skip rvc-qpr-dev-plus-aosp-without-vendor@6881855

Bug: 172690556
Merged-In: I51672944372d24483679d6f81df4e80869d3fd99
Change-Id: Ib64d7c9c68de9058bae79d0de9f9c59341d207c3

3 years agoMerge "Convert to lower fs path for createObb()." am: c237cbc575
Martijn Coenen [Thu, 19 Nov 2020 17:48:44 +0000 (17:48 +0000)]
Merge "Convert to lower fs path for createObb()." am: c237cbc575

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1505371

Change-Id: Ib2cacb3602bc21c5e6d03e15337c188ae2f7bdd5

3 years agoMerge "Unmount pass_through path last." am: 2fb2757c2d
Martijn Coenen [Thu, 19 Nov 2020 17:48:36 +0000 (17:48 +0000)]
Merge "Unmount pass_through path last." am: 2fb2757c2d

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1505131

Change-Id: I16944515f12a656d9b6a2da23a04b7615c9e2f1a

3 years agoMerge "Convert to lower fs path for createObb()."
Martijn Coenen [Thu, 19 Nov 2020 17:31:54 +0000 (17:31 +0000)]
Merge "Convert to lower fs path for createObb()."

3 years agoMerge "Unmount pass_through path last."
Martijn Coenen [Thu, 19 Nov 2020 17:31:45 +0000 (17:31 +0000)]
Merge "Unmount pass_through path last."

3 years agoConvert to lower fs path for createObb().
Martijn Coenen [Thu, 19 Nov 2020 09:49:45 +0000 (10:49 +0100)]
Convert to lower fs path for createObb().

Since /storage/emulated/userId isn't accessible for users != userId,
and vold should anyway try to avoid accessing the FUSE filesystem itself.

Bug: 172078780
Test: atest StorageManagerTest --user-type secondary_user
Change-Id: I98222bf844a6b7d8ec0d9873eddc71f61aa68c90

3 years agoUnmount pass_through path last.
Martijn Coenen [Thu, 5 Nov 2020 09:34:28 +0000 (10:34 +0100)]
Unmount pass_through path last.

There've been reports of issues where, when a volume is ejected, the
MediaProvider process gets killed. This happens because the
MediaProvider has a file open on the volume (eg, during a scan). We do
abort the scan when the volume is ejected, however this could take some
time. So, we give MediaProvider a bit more time before getting killed,
by only looking for files open on the pass_through paths last. This
order anyway seems to make more sense - ideally we kill apps using
external storage before we unmount the pass_through path underlying it.

Bug: 171367622
Test: atets AdoptableHostTest
Change-Id: Ie8eacaa72a80ff8161ecf1e8c0243afcd890ee39

3 years agoMerge "Call earlyBootEnded from vdc." am: 17ebcf7f99
Martijn Coenen [Wed, 18 Nov 2020 08:09:07 +0000 (08:09 +0000)]
Merge "Call earlyBootEnded from vdc." am: 17ebcf7f99

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1496221

Change-Id: Ib084a4c16c790e274232fd4056b3af4b0e39fff7

3 years agoMerge "Call earlyBootEnded from vdc."
Martijn Coenen [Wed, 18 Nov 2020 07:51:31 +0000 (07:51 +0000)]
Merge "Call earlyBootEnded from vdc."

3 years agoMerge "Switch to exfatprogs compatible fsck parameter" am: dfd36fe6b6
Eric Biggers [Thu, 12 Nov 2020 17:48:16 +0000 (17:48 +0000)]
Merge "Switch to exfatprogs compatible fsck parameter" am: dfd36fe6b6

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1441937

Change-Id: Ibd14595638ab5daf7965043d64cc5c06dddd1b7c

3 years agoMerge "Switch to exfatprogs compatible fsck parameter"
Eric Biggers [Thu, 12 Nov 2020 17:33:16 +0000 (17:33 +0000)]
Merge "Switch to exfatprogs compatible fsck parameter"

3 years agoCall earlyBootEnded from vdc.
Martijn Coenen [Thu, 12 Nov 2020 09:59:13 +0000 (10:59 +0100)]
Call earlyBootEnded from vdc.

This allows us to determine the place where early boot ends from init.
It also allows fixing a bug where early boot wasn't ended previously on
devices without metadata encryption.

Bug: 168585635
Bug: 173005594
Test: inspect logs
Change-Id: I78775672a7d3c140e007235a10fb1d1bc816fcee

3 years agoSwitch to exfatprogs compatible fsck parameter
LuK1337 [Tue, 29 Sep 2020 18:36:50 +0000 (20:36 +0200)]
Switch to exfatprogs compatible fsck parameter

exfatprogs accepts 'y' for no interaction repair.

Change-Id: I2c436816a293a36fc9f0cd635cdb9ca3b5f88bfc

3 years agoMerge "KeyStorage: rework key upgrade handling" am: d5de2f22b7
Eric Biggers [Tue, 10 Nov 2020 01:11:13 +0000 (01:11 +0000)]
Merge "KeyStorage: rework key upgrade handling" am: d5de2f22b7

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1483694

Change-Id: Ib6c052565b3fe79eeb928daa564a7431f89aed22

3 years agoMerge "KeyStorage: rework key upgrade handling"
Eric Biggers [Tue, 10 Nov 2020 00:39:24 +0000 (00:39 +0000)]
Merge "KeyStorage: rework key upgrade handling"

3 years agoKeyStorage: rework key upgrade handling
Eric Biggers [Fri, 6 Nov 2020 03:58:26 +0000 (19:58 -0800)]
KeyStorage: rework key upgrade handling

Remove the error-prone 'keepOld' parameter, and instead make begin()
(renamed to BeginKeymasterOp()) do all the key upgrade handling.

Don't handle /data and /metadata differently anymore.  Previously, when
a checkpoint is active, key blob files were replaced on /data
immediately; only the actual Keymaster key deletion was delayed until
checkpoint commit.  But it's easier to just delay the key blob file
replacement too, as we have to implement that for /metadata anyway.

Also be more vigilant about deleting any leftover upgraded keys.

Test: Tested on bramble using an OTA rvc-d1-release => master.  In OTA
      success case, verified via logcat that the keys were upgraded and
      then were committed after the boot succeeded.  In OTA failure
      case, verified that the device still boots -- i.e., the old keys
      weren't lost.  Verified that in either case, no
      keymaster_key_blob_upgraded files were left over.  Finally, also
      tried 'pm create-user' and 'pm remove-user' and verified via
      logcat that the Keymaster keys still get deleted.
Change-Id: Ic9c3e63e0bcae0c608fc79050ca4a1676b3852ee

3 years agoMerge "EncryptInplace: fsync cryptofd before reporting success" am: e244a15f34
Eric Biggers [Thu, 5 Nov 2020 19:09:37 +0000 (19:09 +0000)]
Merge "EncryptInplace: fsync cryptofd before reporting success" am: e244a15f34

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1488376

Change-Id: I10ff2f5cccf00fbd3cbac93059ce7f069911e9c4

3 years agoMerge "EncryptInplace: fsync cryptofd before reporting success"
Eric Biggers [Thu, 5 Nov 2020 18:51:13 +0000 (18:51 +0000)]
Merge "EncryptInplace: fsync cryptofd before reporting success"

3 years agoEncryptInplace: fsync cryptofd before reporting success
Eric Biggers [Thu, 5 Nov 2020 02:38:38 +0000 (18:38 -0800)]
EncryptInplace: fsync cryptofd before reporting success

fsync() the cryptofd when done writing to it.  Without this, any
remaining dirty pages in the crypto_blkdev's page cache (which there
might be a lot of, even as much as all the data that was written) won't
be flushed to disk until the cryptofd is closed, which ignores I/O
errors and is also after we already reported 100% completion.

There wasn't an fsync() in the original version either, so we've been
getting by without it, but it seems it should be there.

Change-Id: Idd1be3ae67ce96ecf3946b9efb9fc57414f5805a

3 years agoMerge changes from topic "encryptinplace-cleanup" am: 91e4f1dd76
Eric Biggers [Wed, 4 Nov 2020 19:15:05 +0000 (19:15 +0000)]
Merge changes from topic "encryptinplace-cleanup" am: 91e4f1dd76

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1467990

Change-Id: I50e47bd1cb102b9013542b0676258a79ac44b6b1

3 years agoMerge changes from topic "encryptinplace-cleanup"
Eric Biggers [Wed, 4 Nov 2020 18:47:05 +0000 (18:47 +0000)]
Merge changes from topic "encryptinplace-cleanup"

* changes:
  Refactor EncryptInplace.cpp
  Correctly calculate tot_used_blocks on ext4 with uninit_bg
  Fix memory leak of f2fs_info
  Remove special handling for missing crypto_blkdev
  Check return value of create_crypto_blk_dev()
  Remove unused support for partial encryption

3 years agoRefactor EncryptInplace.cpp
Eric Biggers [Tue, 3 Nov 2020 22:11:02 +0000 (14:11 -0800)]
Refactor EncryptInplace.cpp

Refactor EncryptInplace.cpp to simplify and improve it a lot.  This is
everything that didn't fit into prior commits, including:

- Share a lot more code between ext4, f2fs, and full encryption.

- Improve the log messages.  Most importantly, don't spam the log with
  huge numbers of messages, and don't log errors in expected cases.
  Note: generate_f2fs_info() is still too noisy, but that's part of
  "system/extras", not vold, so this change doesn't change that.

- When possible, do 32K reads/writes for f2fs and for full encryption,
  not just for ext4.  This might improve performance.

- Take advantage of C++ functionality.

- Be more careful about edge cases.  E.g. if the calculation of the
  number of blocks to encrypt was wrong, don't set vold.encrypt_progress
  to > 99 until we're actually done.

The net change is over 200 lines removed.

Before-after comparison of log when enabling metadata encryption:

ext4 before:
    I vold    : Beginning inplace encryption, nr_sec: 16777216
    D vold    : cryptfs_enable_inplace(/dev/block/dm-8, /dev/block/by-name/userdata, 16777216, 0)
    D vold    : Opening/dev/block/by-name/userdata
    D vold    : Opening/dev/block/dm-8
    I vold    : Encrypting ext4 filesystem in place...
    [omitted 6387 log messages]
    I vold    : Encrypted to sector 822084608
    D vold    : cryptfs_enable_inplace_ext4 success
    I vold    : Inplace encryption complete

ext4 after:
    D vold    : encrypt_inplace(/dev/block/dm-8, /dev/block/by-name/userdata, 16777216, false)
    D vold    : ext4 filesystem has 64 block groups
    I vold    : Encrypting ext4 filesystem on /dev/block/by-name/userdata in-place via /dev/block/dm-8
    I vold    : 50327 blocks (206 MB) of 2097152 blocks are in-use
    D vold    : Encrypted 10000 of 50327 blocks
    D vold    : Encrypted 20000 of 50327 blocks
    D vold    : Encrypted 30000 of 50327 blocks
    D vold    : Encrypted 40000 of 50327 blocks
    D vold    : Encrypted 50000 of 50327 blocks
    D vold    : Encrypted 50327 of 50327 blocks
    I vold    : Successfully encrypted ext4 filesystem on /dev/block/by-name/userdata

f2fs before:
    I vold    : Beginning inplace encryption, nr_sec: 16777216
    D vold    : cryptfs_enable_inplace(/dev/block/dm-8, /dev/block/by-name/userdata, 16777216, 0)
    D vold    : Opening/dev/block/by-name/userdata
    D vold    : Opening/dev/block/dm-8
    E vold    : Reading ext4 extent caused an exception
    D vold    : cryptfs_enable_inplace_ext4()=-1
    [omitted logspam from f2fs_sparseblock]
    I vold    : Encrypting from block 0
    I vold    : Encrypted to block 15872
    I vold    : Encrypting from block 16384
    I vold    : Encrypted to block 16385
    I vold    : Encrypting from block 17408
    I vold    : Encrypted to block 17412
    D vold    : cryptfs_enable_inplace_f2fs success
    I vold    : Inplace encryption complete

f2fs after:
    D vold    : encrypt_inplace(/dev/block/dm-8, /dev/block/by-name/userdata, 16777216, false)
    [omitted logspam from f2fs_sparseblock]
    I vold    : Encrypting f2fs filesystem on /dev/block/by-name/userdata in-place via /dev/block/dm-8
    I vold    : 15880 blocks (65 MB) of 2097152 blocks are in-use
    D vold    : Encrypted 10000 of 15880 blocks
    D vold    : Encrypted 15880 of 15880 blocks
    I vold    : Successfully encrypted f2fs filesystem on /dev/block/by-name/userdata

Test: Booted Cuttlefish with metadata encryption enabled and with the
      userdata filesystem using (1) ext4, (2) f2fs, and (3) f2fs but
      with EncryptInplace.cpp patched to not recognize the filesystem
      and fall back to the "full" encryption case.  Checked that the log
      messages were as expected and that /data was mounted.

      I've had no luck testing FDE yet; it doesn't work even without
      these changes.  Suggestions appreciated...

Change-Id: I08fc8465f7962abd698904b5466f3ed080d53953

3 years agoCorrectly calculate tot_used_blocks on ext4 with uninit_bg
Eric Biggers [Tue, 3 Nov 2020 22:11:01 +0000 (14:11 -0800)]
Correctly calculate tot_used_blocks on ext4 with uninit_bg

The calculated number of blocks to encrypt is too high on ext4
filesystems that have the uninit_bg feature.  This is because the
calculation assumes that all blocks not counted in bg_free_blocks_count
need to encrypted.  But actually, uninitialized block groups have inode
blocks which vold doesn't encrypt since they are uninitialized, but they
are "allocated" and thus reduce bg_free_blocks_count.

Therefore, add a helper function num_base_meta_blocks_in_group() which
returns the number of blocks to encrypt in an uninitialized block group.
Use it both for the encryption and for calculating 'tot_used_blocks'.

Also compute 'tot_used_blocks' additively rather than subtractively, as
this is easier to understand.

Test: see I08fc8465f7962abd698904b5466f3ed080d53953
Change-Id: I4d2cb40291da67dd1bafd61289ccb9e6343bfda3

3 years agoFix memory leak of f2fs_info
Eric Biggers [Tue, 3 Nov 2020 22:11:01 +0000 (14:11 -0800)]
Fix memory leak of f2fs_info

'struct f2fs_info' from system/extras/f2fs_utils is supposed to be
freed using free_f2fs_info(), not just free().

Test: see I08fc8465f7962abd698904b5466f3ed080d53953
Change-Id: If6e75e5c604b40be24538b156a37cc76f4f0d4f7

3 years agoRemove special handling for missing crypto_blkdev
Eric Biggers [Tue, 3 Nov 2020 22:11:01 +0000 (14:11 -0800)]
Remove special handling for missing crypto_blkdev

This logic is no longer necessary, since the code that creates the
crypto_blkdev (create_crypto_blk_dev() in MetadataCrypt.cpp or in
cryptfs.cpp) now waits for the block device to appear before continuing.

It's also worth noting that the retry loop was only present for ext4,
not for f2fs, yet most Android devices are using f2fs these days.

Test: see I08fc8465f7962abd698904b5466f3ed080d53953
Change-Id: I173ca6cc187a810e008990dfa22aede58632db25

3 years agoCheck return value of create_crypto_blk_dev()
Eric Biggers [Tue, 3 Nov 2020 22:11:00 +0000 (14:11 -0800)]
Check return value of create_crypto_blk_dev()

cryptfs_enable_internal() forgot to check the return value of
create_crypto_blk_dev(), so it was continuing to
cryptfs_enable_inplace() when creating the dm-crypt device failed, which
doesn't make sense.

Test: see I08fc8465f7962abd698904b5466f3ed080d53953
Change-Id: If9f20069d0f084150aa887a350f7c0c31a6d80f2

3 years agoRemove unused support for partial encryption
Eric Biggers [Tue, 3 Nov 2020 22:11:00 +0000 (14:11 -0800)]
Remove unused support for partial encryption

Commit 87999173dd79 ("Don't corrupt ssd when encrypting and power
fails") added a lot of code to handle pausing in-place conversion from
unencrypted => FDE when the battery was low, and resuming it later.

It was eventually decided that this wasn't needed, and commit
7e17e2d22678 ("Don't worry about battery levels when encrypting")
removed the checks for low battery.

This made the partial encryption code unused.  So remove it.

Note that this was cluttering up the metadata encryption code too, since
EncryptInplace.cpp is now shared by both FDE and metadata encryption.

Bug: 16868177
Test: see I08fc8465f7962abd698904b5466f3ed080d53953
Change-Id: Ibd2eb08a2aa15938097abcb8a67b5a813c4d76c7

3 years agoMerge changes I8d2bd67d,I704522b2 am: 27f3ab89d0
Eric Biggers [Tue, 3 Nov 2020 17:48:09 +0000 (17:48 +0000)]
Merge changes I8d2bd67d,I704522b2 am: 27f3ab89d0

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1484498

Change-Id: I28ef08b0fe9b3c94b02769f43e21f574e524da57

3 years agoMerge changes I8d2bd67d,I704522b2
Eric Biggers [Tue, 3 Nov 2020 17:02:46 +0000 (17:02 +0000)]
Merge changes I8d2bd67d,I704522b2

* changes:
  FsCrypt: silently skip "." and ".." when loading keys
  Utils: add IsDotOrDotDot() and use it in the appropriate places

3 years agoMerge "KeyUtil: don't use keepOld=true for system DE and volume keys" am: 4a969dba60
Eric Biggers [Tue, 3 Nov 2020 00:08:56 +0000 (00:08 +0000)]
Merge "KeyUtil: don't use keepOld=true for system DE and volume keys" am: 4a969dba60

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1480696

Change-Id: I45f11f64c84b540a27cdc39af493a2ee4e552bce

3 years agoFsCrypt: silently skip "." and ".." when loading keys
Eric Biggers [Mon, 2 Nov 2020 23:11:06 +0000 (15:11 -0800)]
FsCrypt: silently skip "." and ".." when loading keys

Avoid logging useless messages like:

    D vold    : Skipping non-key .
    D vold    : Skipping non-key ..
    D vold    : Skipping non-de-key .
    D vold    : Skipping non-de-key ..

Change-Id: I8d2bd67d554605a5ab9faadd3730870dfe0881f6

3 years agoUtils: add IsDotOrDotDot() and use it in the appropriate places
Eric Biggers [Mon, 2 Nov 2020 23:31:56 +0000 (15:31 -0800)]
Utils: add IsDotOrDotDot() and use it in the appropriate places

Change-Id: I704522b26acfb3e7c423d9a14d69ede513b50482

3 years agoMerge "KeyUtil: don't use keepOld=true for system DE and volume keys"
Eric Biggers [Mon, 2 Nov 2020 23:31:23 +0000 (23:31 +0000)]
Merge "KeyUtil: don't use keepOld=true for system DE and volume keys"

3 years agoKeyUtil: don't use keepOld=true for system DE and volume keys
Eric Biggers [Thu, 29 Oct 2020 19:59:28 +0000 (12:59 -0700)]
KeyUtil: don't use keepOld=true for system DE and volume keys

Commit 77df7f207dce / http://aosp/1217657 ("Refactor to use
EncryptionPolicy everywhere we used to use raw_ref") unintentionally
made fscrypt_initialize_systemwide_keys() start specifying keepOld=true
(via default parameter value) when retrieving the system DE key, and
likewise for read_or_create_volkey() and volume keys.

As a result, if the associated Keymaster key needs to be upgraded, the
upgraded key blob gets written to "keymaster_key_blob_upgraded", but it
doesn't replace the original "keymaster_key_blob", nor is the original
key deleted from Keymaster.  This happens at every boot, eventually
resulting in the RPMB partition in Keymaster becoming full.

Only the metadata encryption key ever needs keepOld=true, since it's the
only key that isn't stored in /data, and the purpose of keepOld=true is
to allow a key that isn't stored in /data to be committed or rolled back
when a userdata checkpoint is committed or rolled back.

So, fix this bug by removing the default value of keepOld, and
specifying false everywhere except the metadata encryption key.

Note that when an affected device gets this fix, it will finally upgrade
its system DE key correctly.  However, this fix doesn't free up space in
Keymaster that was consumed by this bug.

Test: On bramble:
  - Flashed rvc-d1-dev build, with wiping userdata
  - Flashed a newer build, without wiping userdata
  - Log expectedly shows key upgrades:
        $ adb logcat | grep 'Upgrading key'
        D vold    : Upgrading key: /metadata/vold/metadata_encryption/key
        D vold    : Upgrading key: /data/unencrypted/key
        D vold    : Upgrading key: /data/misc/vold/user_keys/de/0
        D vold    : Upgrading key: /data/misc/vold/user_keys/ce/0/current
  - Rebooted
  - Log unexpectedly shows the system DE key being upgraded again:
        $ adb logcat | grep 'Upgrading key'
        D vold    : Upgrading key: /data/unencrypted/key
  - "keymaster_key_blob_upgraded" unexpectedly still exists:
        $ adb shell find /data /metadata -name keymaster_key_blob_upgraded
        /data/unencrypted/key/keymaster_key_blob_upgraded
  - Applied this fix and flashed, without wiping userdata
  - Log shows system DE key being upgraded (expected because due to the
    bug, the upgraded key didn't replace the original one before)
        $ adb logcat | grep 'Upgrading key'
        D vold    : Upgrading key: /data/unencrypted/key
  - "keymaster_key_blob_upgraded" expectedly no longer exists
        $ adb shell find /data /metadata -name keymaster_key_blob_upgraded
  - Rebooted
  - Log expectedly doesn't show any more key upgrades
        $ adb logcat | grep 'Upgrading key'
Bug: 171944521
Bug: 172019387
Change-Id: I42d3f5fbe32cb2ec229f4b614cfb271412a3ed29