OSDN Git Service
Chih-Wei Huang [Fri, 12 Aug 2016 17:58:29 +0000 (01:58 +0800)]
vold3: support the old SDCARD=xxx function
By specifying SDCARD=xxx in kernel cmdline, vold will try to mount
that disk or partition as a sdcard. This is an old function we've
added to vold 2.0. Now re-implement it in vold 3.0. Some people
still like and use it.
Tom Marshall [Thu, 5 Nov 2015 19:20:54 +0000 (11:20 -0800)]
vold: Honor mount options for ext4/f2fs partitions
* Save mount options and fstype for DiskPartition objects
* Pass mount options and fstype to PublicVolume ctor
* Pass mount options to ext4::Mount/f2fs:Mount
* Use specified/default fstype if blkid fails
This is trivially extensible for other fs types.
[mikeioannina] Adapt for Pie
[cwhuang] Adapt for Android Q
Change-Id: Ie5dd27f26a4a7129dd9efe6a7ad0a589928282a0
Tom Marshall [Wed, 4 Nov 2015 23:44:44 +0000 (15:44 -0800)]
vold: Support internal storage partitions
* Support nonremovable disks and expose a nonremovable flag in the
DiskCreated message.
* New DiskPartition class to hold single partitions. DiskPartition is
used when the fs_mgr entry has a partnum (eg. when fs_mgr_flags
contains voldmanaged=label:#). Override disk partitioning methods
to prevent destroying the emmc.
Change-Id: Id7ec3ea409b5c96e691730604e4b1e9cc3aa9d33
vold: Correct base header paths
These headers were moved to android-base
Change-Id: I3eaa8316006b9017c5f5e31cd1e91efc2862106d
DiskPartition.cpp: Add sysmacros.h dependency for major/minor
Change-Id: I22c267c8f12b40fb3e2295becd88f12b75907b69
Signed-off-by: Adrian DC <radian.dc@gmail.com>
[mikeioannina] Adapt for Pie
Change-Id: Id7ec3ea409b5c96e691730604e4b1e9cc3aa9d33
Dan Pasanen [Wed, 28 Oct 2015 03:52:37 +0000 (22:52 -0500)]
vold: add support for more filesystems for public storage
* Add exfat and ntfs support based off f2fs and ported to use fuse
* Add support for both along with f2fs and ext4 to PublicVolume
* Also attempt to mount any volume if it's been determined that
the kernel supports it
Change-Id: I0a83761cefd97791e3ec84a18e199dfd27a5ed0b
vold: fs: Fix build errors
* Migrate from base to android-base
* Add missing , in Ext4 Mount function
[AdrianDC] Ignore unpatched ext4 arguments
[mikeioannina] Update for Pie native exfat
[cwhuang] Update for Android Q
Change-Id: I875b5763c472aa7da2976ec7c5db7cf28c913876
vold: ntfs: Use strlcat
Clang now enforces length checking :/
Change-Id: I495b4cb2ee530e72b1084248f0549d63589523b0
Change-Id: I0a83761cefd97791e3ec84a18e199dfd27a5ed0b
Android Build Coastguard Worker [Sat, 13 Nov 2021 22:09:36 +0000 (22:09 +0000)]
Snap for
7913183 from
1d49ec7aab20d1b4b7b6e6dda28fcfaaf73a64e3 to sc-v2-release
Change-Id: I3d0bda3482c78abee6d8da5c58d39cb8771182a3
Keith Mok [Fri, 12 Nov 2021 22:48:55 +0000 (22:48 +0000)]
Merge "vold: Reboot if vold failure" into sc-v2-dev
Android Build Coastguard Worker [Wed, 3 Nov 2021 23:10:09 +0000 (23:10 +0000)]
Snap for
7880955 from
e0f8956247e614c9612074bbec95bd720d69fa6e to sc-v2-release
Change-Id: Ia1b9c31b371784a60d85ed8eb7eca84733b68d54
Yurii Zubrytskyi [Wed, 3 Nov 2021 18:59:09 +0000 (18:59 +0000)]
Merge "[vold] Check incremental paths before mounting" into sc-v2-dev
Yurii Zubrytskyi [Tue, 19 Oct 2021 05:33:15 +0000 (22:33 -0700)]
[vold] Check incremental paths before mounting
Vold was trusting system_server too much and allowed for pretty
much any path in mount()/bindMount() calls for incremental.
This CL adds validation to make sure it's only accessing own
directories. This includes enforcing no symlinks in the paths
Ignore-AOSP-First: security fix
Bug:
198657657
Test: manual
Change-Id: I6035447f94ef44c4ae3294c3ae47de2d7210683a
Merged-In: I6035447f94ef44c4ae3294c3ae47de2d7210683a
Yurii Zubrytskyi [Thu, 28 Oct 2021 21:37:12 +0000 (14:37 -0700)]
Enable dynamic read logs buffer sizing for incfs
Default buffer size of 4 pages causes many missed log records
because of ring buffer overflows. This change adds a dynamic
sizing, up to 32 pages, that has shown to decrease dropped
records pretty much to nil
Fallback code automatically decreases the buffer size in case
of kernel memory fragmentation - some logs are still much
better than no logs at all
Bug:
203551890
Test: manual, adb install <Apk>; checked for fallback by
increasing max size to 1024 pages
Change-Id: I0ea46c1ad2534b1dbb5faaead52afab88b66747b
Merged-In: I0ea46c1ad2534b1dbb5faaead52afab88b66747b
Keith Mok [Mon, 4 Oct 2021 20:49:17 +0000 (20:49 +0000)]
vold: Reboot if vold failure
Vold stores some status in memory.
If vold crashed and restarted, those status are not
restored. Reboot device if vold on failure.
Bug:
202048432
Test: manually kill vold
Merged-In: Ic56acd9cc906b0166adf805023e34bbd6b3648a5
Change-Id: Ic56acd9cc906b0166adf805023e34bbd6b3648a5
Android Build Coastguard Worker [Thu, 9 Sep 2021 23:14:39 +0000 (23:14 +0000)]
Snap for
7717622 from
4fb97923e5bc781245594e7b422eb2e127c6648d to sc-v2-release
Change-Id: Ic504e969aa38aaba01cbd69efddf9057827fc356
Keith Mok [Wed, 8 Sep 2021 22:25:19 +0000 (22:25 +0000)]
Merge "Set a property if seed binding is enabled." into sc-v2-dev
Keith Mok [Wed, 1 Sep 2021 18:37:48 +0000 (18:37 +0000)]
Set a property if seed binding is enabled.
For vehicle binding seed atest
Bug:
157501579
Test: atest vehicle-binding-seed-sh
Merged-In: Ie1dad1735193ce722ec036e38f826a6b90e94526
Change-Id: Ie1dad1735193ce722ec036e38f826a6b90e94526
Android Build Coastguard Worker [Wed, 1 Sep 2021 23:10:20 +0000 (23:10 +0000)]
Snap for
7695339 from
28f635a556bdb7cb3e77331329ed97ca9d60242b to sc-v2-release
Change-Id: I791acda6c82f58dc7deabdcbaaeb0102d2075777
Haiping Yang [Wed, 1 Sep 2021 17:34:30 +0000 (17:34 +0000)]
Revert "Add ROLLBACK_RESISTANCE tag to key usage" am:
c0a46c8106
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/
15718439
Change-Id: I22035c8c8f548d07c6ddcc9e03333515a0dc959b
Haiping Yang [Mon, 23 Aug 2021 01:24:25 +0000 (01:24 +0000)]
Revert "Add ROLLBACK_RESISTANCE tag to key usage"
This reverts commit
2601eb7f8c241f9cf24510115e0a572819fd0514.
Ignore-AOSP-First: reverted change was introduced in sc-dev
Bug:
196887752
Test: R11 boots on master
Reason for revert: R11 boot failure on master
Change-Id: I8d2f566f3991f30cd65c48d959d26df8b6c85f32
Android Build Coastguard Worker [Sat, 14 Aug 2021 01:12:31 +0000 (01:12 +0000)]
Snap for
7639977 from
466e30dffe58369fc5a440b2b018affa625b9a18 to sc-v2-release
Change-Id: Ieed79134c0874eeb5f2621a458370b2ed64cfc2a
Paul Crowley [Fri, 13 Aug 2021 03:01:43 +0000 (03:01 +0000)]
Merge "Revert^2 "Detect factory reset and deleteAllKeys"" into sc-dev am:
1566a5bf00 am:
eae11551bd
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/
15547746
Change-Id: I5a25f5527538b36dc376bc1a56170411705e7afa
Paul Crowley [Fri, 13 Aug 2021 02:46:44 +0000 (02:46 +0000)]
Merge "Revert^2 "Detect factory reset and deleteAllKeys"" into sc-dev am:
1566a5bf00
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/
15547746
Change-Id: I89bdf3d65c2461f882d39089e64961537888955b
Paul Crowley [Fri, 13 Aug 2021 02:33:43 +0000 (02:33 +0000)]
Merge "Revert^2 "Detect factory reset and deleteAllKeys"" into sc-dev
Paul Crowley [Thu, 12 Aug 2021 19:20:40 +0000 (19:20 +0000)]
Revert^2 "Detect factory reset and deleteAllKeys"
Revert submission
15536724-revert-
15521094-vold-deleteAllKeys-GDJSMLXRVZ
Reason for revert: Underlying KM problem fixed
Reverted Changes:
I8e2621bef:Revert "Detect factory reset and deleteAllKeys"
I546b980bb:Revert "Add deleteAllKeys to IKeystoreMaintenance"...
I1ed68dd9e:Revert "Allow vold to deleteAllKeys in Keystore"
Bug:
187105270
Test: booted Cuttlefish twice
Merged-In:
1e6a5f51065173224700d551693867bd33c7e5b9
Change-Id: Id641444b4ebba951aa8c5474ed60844cfaae1e20
Android Build Coastguard Worker [Thu, 12 Aug 2021 23:09:55 +0000 (23:09 +0000)]
Snap for
7636897 from
426ec8ad34d35c631993f467dc63d6af2b29e7df to sc-v2-release
Change-Id: Ibcd407bff771ffdcb34491e53c0f5ff9a38fc28f
Shawn Willden [Thu, 12 Aug 2021 01:57:03 +0000 (01:57 +0000)]
Merge "Revert "Detect factory reset and deleteAllKeys"" into sc-dev am:
90c818d9ee am:
fb0d651988
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/
15536478
Change-Id: Ib8b347507793c00f6f2c585c7cadf4bdbdb0961c
Shawn Willden [Thu, 12 Aug 2021 01:33:01 +0000 (01:33 +0000)]
Merge "Revert "Detect factory reset and deleteAllKeys"" into sc-dev am:
90c818d9ee
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/
15536478
Change-Id: Ie0847281b708c9eb06d54a7078fd6476e65a4099
Shawn Willden [Thu, 12 Aug 2021 01:17:13 +0000 (01:17 +0000)]
Merge "Revert "Detect factory reset and deleteAllKeys"" into sc-dev
Shawn Willden [Thu, 12 Aug 2021 01:03:12 +0000 (01:03 +0000)]
Revert "Detect factory reset and deleteAllKeys"
Revert "Add deleteAllKeys to IKeystoreMaintenance"
Revert "Enable deleteAllKeys from vold"
Revert "Allow vold to deleteAllKeys in Keystore"
Revert submission
15521094-vold-deleteAllKeys
Reason for revert: Causes infinite loop in Trusty KeyMint
Reverted Changes:
I9c5c54714:Detect factory reset and deleteAllKeys
I2fb0e94db:Allow vold to deleteAllKeys in Keystore
Id23f25c69:Add deleteAllKeys to IKeystoreMaintenance
Ife779307d:Enable deleteAllKeys from vold
I4312b9a11:Enable deleteAllKeys from vold
Bug:
187105270
Change-Id: I8e2621bef234d0a59be422b8d1d8d52a91378a5e
TreeHugger Robot [Wed, 11 Aug 2021 23:33:15 +0000 (23:33 +0000)]
Merge "Add ROLLBACK_RESISTANCE tag to key usage" into sc-dev am:
8f19fd90e3 am:
7c5c6d8b43
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/
15534270
Change-Id: I712e82980a8f5383aa17f43066923dc29dfd8210
TreeHugger Robot [Wed, 11 Aug 2021 23:18:07 +0000 (23:18 +0000)]
Merge "Add ROLLBACK_RESISTANCE tag to key usage" into sc-dev am:
8f19fd90e3
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/
15534270
Change-Id: I91b9f7520cd4b039ff43f728c6eef6357efeed65
TreeHugger Robot [Wed, 11 Aug 2021 22:59:40 +0000 (22:59 +0000)]
Merge "Add ROLLBACK_RESISTANCE tag to key usage" into sc-dev
Paul Crowley [Wed, 11 Aug 2021 22:16:58 +0000 (22:16 +0000)]
Detect factory reset and deleteAllKeys am:
0f74bd4811 am:
e00101c162
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/
15517876
Change-Id: I69599c6df94b66215fafe025bd6f8373ac44fbf7
Paul Crowley [Wed, 11 Aug 2021 22:01:51 +0000 (22:01 +0000)]
Detect factory reset and deleteAllKeys am:
0f74bd4811
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/
15517876
Change-Id: I3ac68496357b62e0887b41780299166d01d8fe29
[6;7~ [Wed, 11 Aug 2021 19:46:49 +0000 (12:46 -0700)]
Add ROLLBACK_RESISTANCE tag to key usage
If KM is upgraded from a version that does not support rollback
resistance to one that does, we really want our upgraded keys to
include rollback resistance. By passing this tag in when we use the
keys, we ensure that the tag is passed into the upgradeKey request
whenever it is made, which some KM implementations can use to add
rollback resistance to our keys.
Bug:
187105270
Ignore-AOSP-First: no merge path to this branch from AOSP.
Test: Manual
Change-Id: I6154fe26a10b60cd686cc60dbc2e0a85c152f43b
Paul Crowley [Fri, 6 Aug 2021 22:16:10 +0000 (15:16 -0700)]
Detect factory reset and deleteAllKeys
Where metadata encryption is enabled, if there is no metadata encryption
key present and we are generating one anew, then there has been a
factory reset, and this is the first key to be generated. We then call
deleteAllKeys to ensure data from before the factory reset is securely
deleted.
This shouldn't really be necessary; the factory reset call itself
should be doing this. However there are currently three factory reset
paths (settings, recovery, fastboot -w) and it is not clear that all
three are doing this correctly on all devices. Obviously an attacker
can prevent this code from being run by running a version of the OS
that does not include this change; however, if the bootloader is
locked, then keys will be version bound such that they will only work
on locked devices with a sufficiently recent version of the OS. If
every sufficiently recent signed version of the OS includes this change
the attack is defeated.
Bug:
187105270
Test: booted Cuttlefish twice, checked logs
Ignore-AOSP-First: no merge path to this branch from AOSP.
Merged-In: I9c5c547140e8b1bbffb9c1d215f75251f0f1354e
Change-Id: I9c5c547140e8b1bbffb9c1d215f75251f0f1354e
Android Build Coastguard Worker [Fri, 23 Jul 2021 01:10:19 +0000 (01:10 +0000)]
Snap for
7574908 from
c11f7de95d3f57aa3c7b4c56cc9846bbd550fb82 to sc-v2-release
Change-Id: I2d8d62887fcb26c83971f8e0112eef24b42921d9
Sean Keys [Wed, 7 Jul 2021 22:38:04 +0000 (22:38 +0000)]
Add command for setting the key binding seed
The seed value is passed to vold early in startup so that the
key-encryption keys are bound to the seed. This is useful for systems
like auto, in which the Android device may not require credentials to
use. In that case, the device should be bound to the rest of the system
(the car, in the case of auto) to guard against theft.
cherry-pick: aosp/
1757970
Test: manual
Bug:
157501579
Change-Id: I2e16387b0752a30ef226b5ddf32ebf955aa9610a
Merged-In: I2e16387b0752a30ef226b5ddf32ebf955aa9610a
Android Build Coastguard Worker [Sat, 26 Jun 2021 03:10:32 +0000 (03:10 +0000)]
Snap for
7495312 from
0b26eb0701ec192ba3375d016018f30f94242351 to sc-v2-release
Change-Id: Ie94389b49f0659535676199af135e0cf84e94d68
Eric Biggers [Fri, 25 Jun 2021 21:07:46 +0000 (21:07 +0000)]
Ignore too-early earlyBootEnded on FDE devices am:
2ddc1338d7
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/
15109082
Change-Id: I23c01e02082020de396bc34b2846def0bb9c14d4
Eric Biggers [Thu, 24 Jun 2021 18:13:24 +0000 (11:13 -0700)]
Ignore too-early earlyBootEnded on FDE devices
Don't call IKeystoreMaintenance::earlyBootEnded() too early on FDE
devices, so that keystore2 doesn't have to be restarted.
Bug:
192090857
Test: Tested FDE on Cuttlefish, both first and non-first boots.
Verified via log that earlyBootEnded is now called only when it
should be, and that keystore2 no longer has to be restarted.
Change-Id: I03f816db194a8276ad19ca99b3c8894e8a5fed23
(cherry picked from commit
4859e0ca0f7fc5da217e8b388da76ece41dd726e)
Merged-In: I03f816db194a8276ad19ca99b3c8894e8a5fed23
android-build-team Robot [Sat, 15 May 2021 03:10:38 +0000 (03:10 +0000)]
Snap for
7362794 from
3887f9da78e869a906d1f4c37754af3901e9518b to sc-v2-release
Change-Id: I1e125b1a92d0cbfef2ba8d4438f1cba25bd541e4
Wale Ogunwale [Fri, 14 May 2021 13:37:55 +0000 (13:37 +0000)]
Revert "Change mounting storage data and obb flag to on by default" am:
6cc9a1d3dd
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/
14536506
Change-Id: I37e0580a6dd34c9006df7299549dde948e5d0b36
Wale Ogunwale [Thu, 13 May 2021 22:17:21 +0000 (22:17 +0000)]
Revert "Change mounting storage data and obb flag to on by default"
Revert "Change mounting storage data and obb flag to on by default"
Revert "Remove storage app data isolation checking in CTS"
Revert submission
14325408-enable_storage_iso_2
Reason for revert: b/
187939590
Reverted Changes:
I6391b7381:Change mounting storage data and obb flag to on by...
Ic2f3d1be2:Remove storage app data isolation checking in CTS
Iffa8339b1:Change mounting storage data and obb flag to on by...
Bug:
187939590
Bug:
148049767
Change-Id: I8ef3e6fe0210bdf58e1292605ac1cc33a2eaafea
android-build-team Robot [Fri, 14 May 2021 01:10:37 +0000 (01:10 +0000)]
Snap for
7360053 from
6c0c4e8f948886758de985976d4a57e53133cc9c to sc-v2-release
Change-Id: I6a3001dc5c50fecb0cbae24e6f41d797d07af823
Satya Tangirala [Thu, 13 May 2021 23:16:52 +0000 (23:16 +0000)]
Merge "Fix bug with deferred commits for key upgrades in temporary directories" am:
54ebfb5806 am:
38c07b96a1 am:
a387eda4d4 am:
a1837ca9fe
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1706645
Change-Id: I27d846d7ba420db0e43a190a6638412dbbde909e
Satya Tangirala [Thu, 13 May 2021 22:58:51 +0000 (22:58 +0000)]
Merge "Fix bug with deferred commits for key upgrades in temporary directories" am:
54ebfb5806 am:
38c07b96a1 am:
a387eda4d4
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1706645
Change-Id: I25a94c70abac50c65c1d04215bd58995e73f72ff
Satya Tangirala [Thu, 13 May 2021 22:42:09 +0000 (22:42 +0000)]
Merge "Fix bug with deferred commits for key upgrades in temporary directories" am:
54ebfb5806 am:
38c07b96a1
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1706645
Change-Id: If03725290c7a6307255212471d682933360d2d9c
Satya Tangirala [Thu, 13 May 2021 22:26:53 +0000 (22:26 +0000)]
Merge "Fix bug with deferred commits for key upgrades in temporary directories" am:
54ebfb5806
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1706645
Change-Id: I441e7684b9e35d168ef034456311e95c01e8b18b
Satya Tangirala [Thu, 13 May 2021 21:59:41 +0000 (21:59 +0000)]
Merge "Fix bug with deferred commits for key upgrades in temporary directories"
Satya Tangirala [Thu, 13 May 2021 07:43:03 +0000 (00:43 -0700)]
Fix bug with deferred commits for key upgrades in temporary directories
storeKeyAtomically() stores keys in a temp directory before renaming
that directory to the real target directory. However when the key is
stored in the temporary directory, the Keymaster storage key might get
upgraded, and it's possible that the temp directory is scheduled for a
deferred commit. storeKeyAtomically() renames that temp directory, but
doesn't update the list of directories marked for deferred commit.
This patch fixes this by removing the temp directory from the list and
adding the real target directory to that list instead.
This bug was found when trying to switch from using the guest keymint to
using the host remote keymint implementation on cuttlefish
(aosp/
1701925). The device triggers this bug (and boots to recovery)
when aosp/
1701925 is cherry-picked.
Co-Developed-By: Eric Biggers <ebiggers@google.com>
Test: Cuttlefish boots with and without aosp/
1701925
Change-Id: I3b6fd6ad32ed415da94423cca6f5a121c16472f2
android-build-team Robot [Thu, 13 May 2021 01:10:44 +0000 (01:10 +0000)]
Snap for
7357013 from
29a6d6bb463410de828a495266c1033c2bfdb33b to sc-v2-release
Change-Id: I52ea674d0d2ef24b1f72f690847d641b656f2037
Satya Tangirala [Wed, 12 May 2021 23:56:42 +0000 (23:56 +0000)]
Merge changes from topic "vold-keystore2-fixes" am:
98692ab9bb am:
545a13a568 am:
041bbff0bb am:
6c0c4e8f94
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1705226
Change-Id: Iedbab84332a8c656150b347664cbb4a0c14ff126
Satya Tangirala [Wed, 12 May 2021 23:31:40 +0000 (23:31 +0000)]
Merge changes from topic "vold-keystore2-fixes" am:
98692ab9bb am:
545a13a568 am:
041bbff0bb
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1705226
Change-Id: I160caec0094cf97c65cab0309d50c034016e0204
Satya Tangirala [Wed, 12 May 2021 23:07:33 +0000 (23:07 +0000)]
Merge changes from topic "vold-keystore2-fixes" am:
98692ab9bb am:
545a13a568
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1705226
Change-Id: I5506a4ed4c7105d6102277b6fb659c3e39312197
Satya Tangirala [Wed, 12 May 2021 22:52:36 +0000 (22:52 +0000)]
Merge changes from topic "vold-keystore2-fixes" am:
98692ab9bb
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1705226
Change-Id: I310d09e283e3d8804ba7154295d9b004e95cda98
Satya Tangirala [Wed, 12 May 2021 22:32:32 +0000 (22:32 +0000)]
Merge changes from topic "vold-keystore2-fixes"
* changes:
Remove unused constants and cleanup KeyStorage.cpp
Remove unused parameter "salt" from stretchSecret()
Use AServiceManager_waitForService() to connect to keystore2
Satya Tangirala [Wed, 12 May 2021 02:48:47 +0000 (19:48 -0700)]
Remove unused constants and cleanup KeyStorage.cpp
Now that the salt and hardware auth token related code has been removed,
we can remove the associated (and now unused) constants.
Also cleanup some comments and remove includes related to hardware auth
token support.
Bug:
181910578
Test: Cuttlefish boots.
Change-Id: I3733d5c6bbf6989adc165c554ee53faa2484f4b6
Satya Tangirala [Wed, 7 Apr 2021 21:30:25 +0000 (14:30 -0700)]
Remove unused parameter "salt" from stretchSecret()
stretchSecret() no longer uses the "salt" parameter, so remove it and
simplify callers
Bug:
181910578
Test: Cuttlefish boots.
Change-Id: Ic2d0742b22b98a66da37f435e274c9d385b8e188
Satya Tangirala [Mon, 12 Apr 2021 22:00:33 +0000 (15:00 -0700)]
Use AServiceManager_waitForService() to connect to keystore2
Vold currently uses AServiceManager_getService() to connect to
keystore2, which has an internal timeout of 5s. Since a lot of vold
keystore2 connection failures are fatal, we instead use
AServiceManager_waitForService(), which will wait efficiently for
keystore2 to start, instead of timing out after 5s.
Bug:
185934601
Test: Cuttlefish boots.
Change-Id: Ib4e977a997e020082382e0686f448d1aa72834ec
android-build-team Robot [Wed, 12 May 2021 01:10:35 +0000 (01:10 +0000)]
Snap for
7354453 from
85a78a5ad11d8bca54332833d3f65b6cb73e7a98 to sc-v2-release
Change-Id: Icb658917429f65fdad73e8695f420a943bbefb45
Songchun Fan [Tue, 11 May 2021 22:42:07 +0000 (22:42 +0000)]
Merge "[vold] pass along sysfs name in setOptions" into sc-dev am:
29a6d6bb46
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/
14490318
Change-Id: Ibbc0eb959452f6f307b73dcb30224e1f2c0ead4b
Songchun Fan [Tue, 11 May 2021 22:36:55 +0000 (22:36 +0000)]
Merge "[vold] pass along sysfs name in setOptions" into sc-dev
Treehugger Robot [Tue, 11 May 2021 21:20:03 +0000 (21:20 +0000)]
Merge "Show names of processes killed by KillProcessesWithOpenFiles()" am:
93dd933d85 am:
274804863c am:
c591e3d68f am:
85a78a5ad1
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1697789
Change-Id: I8a0923182fd4585a5c88b5fd43b21b00bec1be32
Eric Biggers [Tue, 11 May 2021 21:19:58 +0000 (21:19 +0000)]
Merge "cryptfs: kill processes more quickly in wait_and_unmount()" am:
297b23837e am:
03e021ba56 am:
9d7718cf05 am:
1e0cdac620
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1702389
Change-Id: I041b698ac14368d24ca00caa02ceaee18fdb0ca4
Treehugger Robot [Tue, 11 May 2021 21:04:06 +0000 (21:04 +0000)]
Merge "Show names of processes killed by KillProcessesWithOpenFiles()" am:
93dd933d85 am:
274804863c am:
c591e3d68f
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1697789
Change-Id: I80cf3cf6b9d4e5e7f0ac32b0230cd9b6418cd047
Eric Biggers [Tue, 11 May 2021 21:04:02 +0000 (21:04 +0000)]
Merge "cryptfs: kill processes more quickly in wait_and_unmount()" am:
297b23837e am:
03e021ba56 am:
9d7718cf05
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1702389
Change-Id: Ice91b35eda0f09cbb9d4a4e500a1e9984940b0f1
Treehugger Robot [Tue, 11 May 2021 21:02:19 +0000 (21:02 +0000)]
Merge "Show names of processes killed by KillProcessesWithOpenFiles()" am:
93dd933d85 am:
274804863c
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1697789
Change-Id: I367b674134c4af229a6490c0c03bee93e3d46cdb
Treehugger Robot [Tue, 11 May 2021 20:39:27 +0000 (20:39 +0000)]
Merge "Show names of processes killed by KillProcessesWithOpenFiles()" am:
93dd933d85
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1697789
Change-Id: Ifc538a3c7cee0df30b727b08333f2e037011656d
Eric Biggers [Tue, 11 May 2021 20:32:28 +0000 (20:32 +0000)]
Merge "cryptfs: kill processes more quickly in wait_and_unmount()" am:
297b23837e am:
03e021ba56
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1702389
Change-Id: I56fa2f1b0a434c15e846319774028c435b905671
Treehugger Robot [Tue, 11 May 2021 20:24:49 +0000 (20:24 +0000)]
Merge "Show names of processes killed by KillProcessesWithOpenFiles()"
Eric Biggers [Tue, 11 May 2021 20:17:12 +0000 (20:17 +0000)]
Merge "cryptfs: kill processes more quickly in wait_and_unmount()" am:
297b23837e
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1702389
Change-Id: I48bdc416c72646af7a6f87bad78e0b759e9f1080
Eric Biggers [Tue, 11 May 2021 20:00:14 +0000 (20:00 +0000)]
Merge "cryptfs: kill processes more quickly in wait_and_unmount()"
Eric Biggers [Tue, 11 May 2021 00:44:34 +0000 (17:44 -0700)]
cryptfs: kill processes more quickly in wait_and_unmount()
In wait_and_unmount(), kill the processes with open files after umount()
has been failing for 2 seconds rather than 17 seconds. This avoids a
long boot delay on devices that use FDE.
Detailed explanation:
On FDE devices, vold needs to unmount the tmpfs /data in order to mount
the real, decrypted /data. On first boot, it also needs to unmount the
unencrypted /data in order to encrypt it in-place.
/data can't be unmounted if files are open inside it. In theory, init
is responsible for killing all processes with open files in /data, via
the property trigger "vold.decrypt=trigger_shutdown_framework".
However, years ago, commit
6e8440fd5072 ("cryptfs: kill processes with
open files on tmpfs /data") added a fallback where vold kills the
processes itself. Since then, in practice people have increasingly been
relying on this fallback, as services keep being added that use /data
but don't get stopped by trigger_shutdown_framework.
This is slowing down boot, as vold sleeps for 17 seconds before it
actually kills the processes.
The problematic services include services that are now started
explicitly in the post-fs-data trigger rather than implicitly as part of
a class (e.g., tombstoned), as well as services that now need to be
started as part of one of the early-boot classes like core or early_hal
but can still open files in /data later (e.g. keystore2 and credstore).
Another complication is that on default-encrypted devices (devices with
no PIN/pattern/password), trigger_shutdown_framework isn't run at all,
but rather it's expected that the relevant services simply weren't
started yet. This means that we can't fix the problem just by fixing
trigger_shutdown_framework to kill all the needed processes.
Therefore, given that the vold fallback is being relied on in practice,
and FDE won't be supported much longer anyway (so simple fixes are very
much preferable here), let's just change wait_and_unmount() in vold to
use more appropriate timeouts. Instead of waiting for 17 seconds before
killing processes, just wait for 2 seconds. Keep the total timeout of
20 seconds, but spend most of it retrying killing the processes, and
only if the unmount is still failing.
This avoids the long boot delays in practice.
Bug:
187231646
Bug:
186165644
Test: Tested FDE on Cuttlefish, and checked logcat to verify that the
boot delay is gone.
Change-Id: Id06a9615a87988c8336396c49ee914b35f8d585b
Songchun Fan [Mon, 10 May 2021 23:19:38 +0000 (16:19 -0700)]
[vold] pass along sysfs name in setOptions
Ignore-AOSP-First: Will cherry-pick to AOSP
BUG:
187308584
Test: atest CtsContentTestCases:android.content.pm.cts.PackageManagerShellCommandIncrementalTest#testInstallWithIdSigNoMissingPages
Change-Id: Iacfe6b735458051f2848b1b766c2b00198b397d9
Eric Biggers [Wed, 5 May 2021 19:11:33 +0000 (12:11 -0700)]
Show names of processes killed by KillProcessesWithOpenFiles()
Otherwise only the pids are shown, and it's hard to tell which
processes actually got killed.
Bug:
187231646
Change-Id: Icccf60d0ad4439d702f36ace31abe092df1c69c2
android-build-team Robot [Sat, 8 May 2021 23:10:13 +0000 (23:10 +0000)]
Snap for
7348217 from
0ae52740907cdcf0bdbf023cddc5b4d6db92c046 to sc-v2-release
Change-Id: Iefc78d92d48f7fdee704e058ad708f6a6a10c8bc
Xin Li [Sat, 8 May 2021 03:06:29 +0000 (03:06 +0000)]
[automerger skipped] Merge "DO NOT MERGE - Mark RQ2A.210105.001 as merged." am:
ef439c5367 -s ours am:
477eb9ac9c -s ours am:
4e3d21ca95 -s ours am:
0ae5274090 -s ours
am skip reason: Merged-In Ic37985f98e6cbfe4fa38b981d3332c4dfc40c5b8 with SHA-1
5f2a9fee66 is already in history
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1699301
Change-Id: Ic48758bdd541e37d824b0ce8ebdada1a1fd4f97c
Xin Li [Sat, 8 May 2021 02:37:01 +0000 (02:37 +0000)]
[automerger skipped] Merge "DO NOT MERGE - Mark RQ2A.210105.001 as merged." am:
ef439c5367 -s ours am:
477eb9ac9c -s ours am:
4e3d21ca95 -s ours
am skip reason: subject contains skip directive
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1699301
Change-Id: I4e3c7fc2fad871976660fa73053cfc3e5d8ea041
Xin Li [Sat, 8 May 2021 02:13:44 +0000 (02:13 +0000)]
[automerger skipped] Merge "DO NOT MERGE - Mark RQ2A.210105.001 as merged." am:
ef439c5367 -s ours am:
477eb9ac9c -s ours
am skip reason: Merged-In Ic37985f98e6cbfe4fa38b981d3332c4dfc40c5b8 with SHA-1
5f2a9fee66 is already in history
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1699301
Change-Id: Ifbb2163da12fde662e0f36a992feb1991ef8e37c
Xin Li [Sat, 8 May 2021 01:48:49 +0000 (01:48 +0000)]
[automerger skipped] Merge "DO NOT MERGE - Mark RQ2A.210105.001 as merged." am:
ef439c5367 -s ours
am skip reason: Merged-In Ic37985f98e6cbfe4fa38b981d3332c4dfc40c5b8 with SHA-1
5f2a9fee66 is already in history
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1699301
Change-Id: Icb4c65c9d0b4e9f1dfefb9d7bdf3e68a799e7fa2
Xin Li [Sat, 8 May 2021 01:28:13 +0000 (01:28 +0000)]
Merge "DO NOT MERGE - Mark RQ2A.210105.001 as merged."
Xin Li [Fri, 7 May 2021 21:32:31 +0000 (14:32 -0700)]
DO NOT MERGE - Mark RQ2A.210105.001 as merged.
Bug:
180401296
Merged-In: Ic37985f98e6cbfe4fa38b981d3332c4dfc40c5b8
Change-Id: Ic82b58f8975ae7b5410d87536342f83e827a7893
android-build-team Robot [Fri, 7 May 2021 01:10:16 +0000 (01:10 +0000)]
Snap for
7343210 from
2645038034de68c65fcbfd2197bea67f5622d137 to sc-v2-release
Change-Id: I20185d6790b8ec3cfc8d233cc76ebe704c6efe88
rickywai [Thu, 6 May 2021 09:27:20 +0000 (09:27 +0000)]
Merge "Always unmount data and obb directory that mounted" am:
ae11ab712f am:
270b1dabbc am:
61ae848c4d am:
2645038034
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1697365
Change-Id: I0797daea651933e99a80a6df7553a647be8e915d
rickywai [Thu, 6 May 2021 09:11:49 +0000 (09:11 +0000)]
Merge "Always unmount data and obb directory that mounted" am:
ae11ab712f am:
270b1dabbc am:
61ae848c4d
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1697365
Change-Id: Ief7e515c3e4ebe52fc9dbcfc781bbcd66c020f80
rickywai [Thu, 6 May 2021 08:40:40 +0000 (08:40 +0000)]
Merge "Always unmount data and obb directory that mounted" am:
ae11ab712f am:
270b1dabbc
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1697365
Change-Id: I3d068df59d9ba0786437a32f1750d271f142581d
rickywai [Thu, 6 May 2021 08:25:13 +0000 (08:25 +0000)]
Merge "Always unmount data and obb directory that mounted" am:
ae11ab712f
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1697365
Change-Id: I44aaffd7ecd95ec60af7559592d684460b32c5da
rickywai [Thu, 6 May 2021 08:09:05 +0000 (08:09 +0000)]
Merge "Always unmount data and obb directory that mounted"
android-build-team Robot [Thu, 6 May 2021 01:11:11 +0000 (01:11 +0000)]
Snap for
7339742 from
d24f5a26e8f3ed699523fcd801e831c23eb3c0b1 to sc-v2-release
Change-Id: I8ce45d62424789ef79eaea03ff81d09d116ed367
Alan Stokes [Wed, 5 May 2021 15:29:02 +0000 (15:29 +0000)]
[automerger skipped] Merge "Only kill apps with storage app data isolation enabled" am:
b2678b6654 am:
53d7796ccd am:
dedb2c1a13 -s ours am:
d24f5a26e8 -s ours
am skip reason: Merged-In I45d9a63ed47cbc27aebb63357a43f51ad62275db with SHA-1
a58b535495 is already in history
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1690874
Change-Id: I98be4a33ef81f7c3ea1d8ce1e7cc60d2f2afc6be
Alan Stokes [Wed, 5 May 2021 15:04:04 +0000 (15:04 +0000)]
[automerger skipped] Merge "Only kill apps with storage app data isolation enabled" am:
b2678b6654 am:
53d7796ccd am:
dedb2c1a13 -s ours
am skip reason: Merged-In I45d9a63ed47cbc27aebb63357a43f51ad62275db with SHA-1
a58b535495 is already in history
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1690874
Change-Id: I641a83e69e7b3ffc267997503cc741cb8a04f030
Alan Stokes [Wed, 5 May 2021 14:45:44 +0000 (14:45 +0000)]
Merge "Only kill apps with storage app data isolation enabled" am:
b2678b6654 am:
53d7796ccd
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1690874
Change-Id: I807f10f18d56c8ff1ef36f6b5cad85f2ee911184
Ricky Wai [Wed, 5 May 2021 14:43:45 +0000 (14:43 +0000)]
Always unmount data and obb directory that mounted
Otherwise, when system removes user's volume, it will hang
as there are mounts (obb and data mounts) still remain mounted in system.
Bug:
187122943
Test: atest UserLifecycleTests#managedProfileUnlock_stopped, it's not blocked anymore
Change-Id: Ic37985f98e6cbfe4fa38b981d3332c4dfc40c5b8
Alan Stokes [Wed, 5 May 2021 14:30:21 +0000 (14:30 +0000)]
Merge "Only kill apps with storage app data isolation enabled" am:
b2678b6654
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1690874
Change-Id: I063073d4419566c11207a147ac3260d4cee671a3
Alan Stokes [Wed, 5 May 2021 14:16:00 +0000 (14:16 +0000)]
Merge "Only kill apps with storage app data isolation enabled"
android-build-team Robot [Wed, 5 May 2021 01:10:33 +0000 (01:10 +0000)]
Snap for
7336869 from
630fa5785ea1c3feeaa649301b264758c9cd83bf to sc-v2-release
Change-Id: Iaa244ba2909603631247c84469257b8db65c22f9
Eric Biggers [Tue, 4 May 2021 17:14:02 +0000 (17:14 +0000)]
Merge "Log error message if setting project quota ID fails" am:
7505efbd5d am:
44df16de69 am:
1768a47b25 am:
630fa5785e
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1694189
Change-Id: I8d86295f891959f72dadecbd2bdf698ef2e633d8
Eric Biggers [Tue, 4 May 2021 16:58:24 +0000 (16:58 +0000)]
Merge "Log error message if setting project quota ID fails" am:
7505efbd5d am:
44df16de69 am:
1768a47b25
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1694189
Change-Id: If76a5f6341b8f21ed49e079e14bd67362fb35f7a
Eric Biggers [Tue, 4 May 2021 16:42:09 +0000 (16:42 +0000)]
Merge "Log error message if setting project quota ID fails" am:
7505efbd5d am:
44df16de69
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1694189
Change-Id: Idc0cff5798358f977445ebe4f104ccf2fbb42cce
Eric Biggers [Tue, 4 May 2021 16:19:11 +0000 (16:19 +0000)]
Merge "Log error message if setting project quota ID fails" am:
7505efbd5d
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1694189
Change-Id: I64ee98eb6505837197aa509a8b9e21a952739966
Eric Biggers [Tue, 4 May 2021 16:06:14 +0000 (16:06 +0000)]
Merge "Log error message if setting project quota ID fails"