OSDN Git Service

android-x86/system-vold.git
4 years agoMerge "vold: Support aborting FUSE connections." into rvc-dev am: cbb69e548a
Martijn Coenen [Fri, 29 May 2020 15:59:55 +0000 (15:59 +0000)]
Merge "vold: Support aborting FUSE connections." into rvc-dev am: cbb69e548a

Change-Id: I587b49c9baed58fb87d27e060faf5d3d4ef8d788

4 years agoMerge "vold: Support aborting FUSE connections." into rvc-dev
Martijn Coenen [Fri, 29 May 2020 15:47:05 +0000 (15:47 +0000)]
Merge "vold: Support aborting FUSE connections." into rvc-dev

4 years agoFuseDaemonHostTest is migrated to CTS and renamed. am: de83802e41
Abhijeet Kaur [Fri, 29 May 2020 15:06:57 +0000 (15:06 +0000)]
FuseDaemonHostTest is migrated to CTS and renamed. am: de83802e41

Change-Id: Iebe048b3e1dd31a63ed62df8c2010e9e5d5d5e4a

4 years agoFuseDaemonHostTest is migrated to CTS and renamed.
Abhijeet Kaur [Thu, 28 May 2020 17:12:40 +0000 (18:12 +0100)]
FuseDaemonHostTest is migrated to CTS and renamed.

FuseDaemonHostTest is migrated to CTS and renamed to
CtsScopedStorageHostTest.

Bug: 142926859
Test: atest --test-mapping
Change-Id: I24c74e20909ccf8868d1487e1cc93f6f2c0108fc

4 years agovold: Support aborting FUSE connections.
Martijn Coenen [Wed, 29 Apr 2020 05:49:41 +0000 (07:49 +0200)]
vold: Support aborting FUSE connections.

This can be done through binder as well as vdc, using 'vdc volume
abort_fuse'.

Bug: 153411204
Test: adb shell vdc volume abort_fuse
Change-Id: I93e46dc1cd361729cc1162c63520cf73152ea409

4 years agoMove enabling sdcardfs behind a property am: f36bdddc7e
Daniel Rosenberg [Thu, 21 May 2020 08:41:18 +0000 (08:41 +0000)]
Move enabling sdcardfs behind a property am: f36bdddc7e

Change-Id: I6ded03167243e9fc60dc2206b5781a84a0140aa3

4 years agoMove enabling sdcardfs behind a property
Daniel Rosenberg [Tue, 12 May 2020 05:58:42 +0000 (22:58 -0700)]
Move enabling sdcardfs behind a property

This allows devices that have sdcardfs enabled in the kernel to not use
it. When external_storage.sdcardfs.enabled=0, sdcardfs will not be
mounted. This is treated as default true to not affect upgrading
devices. It does not use the old ro.sys.sdcardfs as that has been
repurposed over time and no longer can be relied on to turn off
sdcardfs. This is included within emulated_storage.mk

Bug: 155222498
Test: mount|grep "type sdcardfs" should find nothing after boot complete
      if external_storage.sdcardfs.enabled=0
Change-Id: I23d75fb1225aeabbcb1a035ad62fd042b6b3c7b5

4 years agoMerge "Handle virtio in private fs mapping" into rvc-dev am: 0d1fcb90d6
TreeHugger Robot [Wed, 20 May 2020 04:44:11 +0000 (04:44 +0000)]
Merge "Handle virtio in private fs mapping" into rvc-dev am: 0d1fcb90d6

Change-Id: I11bc694a26676dd9f8b0fda7f2078a9bc6ed8719

4 years agoMerge "Handle virtio in private fs mapping" into rvc-dev
TreeHugger Robot [Wed, 20 May 2020 04:28:31 +0000 (04:28 +0000)]
Merge "Handle virtio in private fs mapping" into rvc-dev

4 years agoHandle virtio in private fs mapping
Alistair Delva [Tue, 19 May 2020 22:49:26 +0000 (15:49 -0700)]
Handle virtio in private fs mapping

When the vold core decides if a device is SD or USB, it checks for MMC
or virtio, however when the filesystem type is decided, it does not
check for virtio, only MMC. This causes virtio SD cards to be formatted
with ext4 unconditionally.

This fix is independently correct, but it incidentally gets adopted
storage working on cuttlefish (and Android Emulator) because f2fs can
support fscrypt and casefolding at the same time; ext4 currently cannot.

Bug: 156286088
Change-Id: I0b41670d5f76b2506dad437917c2276f8e0aaccf

4 years agoMerge "Record use of metadata encryption in property" into rvc-dev am: 09ff429e2a
Paul Crowley [Tue, 19 May 2020 23:12:02 +0000 (23:12 +0000)]
Merge "Record use of metadata encryption in property" into rvc-dev am: 09ff429e2a

Change-Id: I75726c747937654cdaea15e299cedf0f72c7c5a5

4 years agoMerge "Record use of metadata encryption in property" into rvc-dev
Paul Crowley [Tue, 19 May 2020 22:59:13 +0000 (22:59 +0000)]
Merge "Record use of metadata encryption in property" into rvc-dev

4 years agoExpand virtio_block check to other virtual devices am: ff1fc9bc41
Alistair Delva [Sat, 16 May 2020 01:47:58 +0000 (01:47 +0000)]
Expand virtio_block check to other virtual devices am: ff1fc9bc41

Change-Id: I2eda581574e0adecf1617624a66af92b540c35c4

4 years agoExpand virtio_block check to other virtual devices
Alistair Delva [Thu, 14 May 2020 23:35:03 +0000 (16:35 -0700)]
Expand virtio_block check to other virtual devices

The Android Emulator isn't the only virtual device the virtio-block
detection code is useful for, and those platforms might not set any
discriminating properties to indicate that they are virtual.

Rework the virtio-block major detection to use /proc/devices instead
of hardcoding the assumption that any virtual platform can have
virtio-block at any experimental major; the new code permits only the
exact experimental major assigned to virtio-block.

The new code runs everywhere, but it will only run once and could be
expanded later to detect dynamic or experimental majors.

Bug: 156286088
Change-Id: Ieae805d08fddd0124a397636f04d99194a9ef7e5

4 years agoMerge "Mount storage Android/data and Android/obb as tmpfs in app namespace" into...
TreeHugger Robot [Wed, 13 May 2020 14:27:17 +0000 (14:27 +0000)]
Merge "Mount storage Android/data and Android/obb as tmpfs in app namespace" into rvc-dev am: dbc0da396a

Change-Id: Ib19a8ab5fc09b138b2dae8b1db2003127d277f10

4 years agoMerge "Mount storage Android/data and Android/obb as tmpfs in app namespace" into...
TreeHugger Robot [Wed, 13 May 2020 14:17:04 +0000 (14:17 +0000)]
Merge "Mount storage Android/data and Android/obb as tmpfs in app namespace" into rvc-dev

4 years agoRevert "ARC++ swap for AppFuseUtil" am: 58d4044082
Satoshi Niwa [Wed, 13 May 2020 14:00:54 +0000 (14:00 +0000)]
Revert "ARC++ swap for AppFuseUtil" am: 58d4044082

Change-Id: I46e6d976324d956b1ad173ba8ed97de760999451

4 years agoRevert "ARC++ swap for AppFuseUtil"
Satoshi Niwa [Tue, 12 May 2020 14:41:40 +0000 (14:41 +0000)]
Revert "ARC++ swap for AppFuseUtil"

This reverts commit ab7c958cc5ca32aa4f79a6e1fc5784eb3286e326.

Reason for revert: ARC is migrating to ARCVM on R, which doesn't use AppFuse any more.

Bug: 110379912
Test: m
Change-Id: Icc827c59530274421e4c94789d96fd3d287e591e

4 years agoMount storage Android/data and Android/obb as tmpfs in app namespace
Ricky Wai [Thu, 7 May 2020 15:01:33 +0000 (16:01 +0100)]
Mount storage Android/data and Android/obb as tmpfs in app namespace

So Android/data and Android/obb won't be accessing fuse anymore,
and apps should not see other packages as well as it's sandboxed
the tmpfs.

Bug: 155462341
Test: atest AppDataIsolationTests pass after feature flag is on
Change-Id: I5658440772e669c1235d318f708a3d336523754f

4 years agoIntroduce postMount() VolumeBase helper. am: 5ec8658abc
Martijn Coenen [Wed, 6 May 2020 09:29:56 +0000 (09:29 +0000)]
Introduce postMount() VolumeBase helper. am: 5ec8658abc

Change-Id: Id8ce7dbaabafef41121dbdf9f6169f1377ae1174

4 years agoIntroduce postMount() VolumeBase helper.
Martijn Coenen [Mon, 4 May 2020 12:57:35 +0000 (14:57 +0200)]
Introduce postMount() VolumeBase helper.

When we're mounting a private volume, we create stacked emulated volumes
on top of it. Due to the ordering there, we would broadcast the emulated
volumes being created *before* the "mounted" status update. This in turn
could cause us to try and mount these emulated volumes before the
underlying private volume is really mounted. This is problematic in
particular on devices that support a filesystem keyring, where we need
to do some additional setup before the devices can be used.

While we could modify StorageManagerService to delay the mount, a safer
fix at this stage of the release is to just fix the ordering of these
events. To achieve that, add a simple postMount() helper, that is called
after a succesful mount. This allows us to setup the volume properly
before trying to mount any stacked volumes.

Bug: 151079464
Test: atest AdoptableHostTest
Change-Id: I2cc4113d4d71d89aa629bb9c0fa9be441355c079

4 years ago[incfs] Use new IncFs_ReleaseControlFds() instead of duping am: fc7b6697b4
Yurii Zubrytskyi [Thu, 23 Apr 2020 21:56:23 +0000 (21:56 +0000)]
[incfs] Use new IncFs_ReleaseControlFds() instead of duping am: fc7b6697b4

Change-Id: Ieff848e641fe40d7a199e460f327ef8aba041dae

4 years ago[incfs] Use new IncFs_ReleaseControlFds() instead of duping
Yurii Zubrytskyi [Thu, 23 Apr 2020 06:23:24 +0000 (23:23 -0700)]
[incfs] Use new IncFs_ReleaseControlFds() instead of duping

Vold needs to pass / accept IncFs control via Binder, so it
neeeds to get and put its internal FDs in and out. Using the new
release() function it works without extra fd duping

Bug: 153704006
Test: builds & boots
Change-Id: I64bc5b1ca9f2c69e34c3a860ed3edbe58bd9ea29

4 years agoMerge "Introduce ro.crypto.uses_fs_ioc_add_encryption_key property" into rvc-dev...
Nikita Ioffe [Tue, 21 Apr 2020 14:44:12 +0000 (14:44 +0000)]
Merge "Introduce ro.crypto.uses_fs_ioc_add_encryption_key property" into rvc-dev am: 4e1e7ef09a

Change-Id: I1d4f16c45ac8082ae5c6aa7216a4636a32e0c0b7

4 years agoMerge "Introduce ro.crypto.uses_fs_ioc_add_encryption_key property" into rvc-dev
Nikita Ioffe [Tue, 21 Apr 2020 14:27:18 +0000 (14:27 +0000)]
Merge "Introduce ro.crypto.uses_fs_ioc_add_encryption_key property" into rvc-dev

4 years agoMerge "Don't do private app-dir permissions/quota on public volumes." into rvc-dev...
Martijn Coenen [Tue, 21 Apr 2020 12:41:54 +0000 (12:41 +0000)]
Merge "Don't do private app-dir permissions/quota on public volumes." into rvc-dev am: 15070b1833

Change-Id: I5b5d4b3f8b8b3ed94264eb79261097b1b93f53a2

4 years agoMerge "Don't do private app-dir permissions/quota on public volumes." into rvc-dev
Martijn Coenen [Tue, 21 Apr 2020 12:22:58 +0000 (12:22 +0000)]
Merge "Don't do private app-dir permissions/quota on public volumes." into rvc-dev

4 years agoMerge "Bind mount install and android writable DATA and OBB dirs" into rvc-dev am...
TreeHugger Robot [Tue, 21 Apr 2020 11:24:14 +0000 (11:24 +0000)]
Merge "Bind mount install and android writable DATA and OBB dirs" into rvc-dev am: 086c96ef6d

Change-Id: I227d66a376dad24ca40612849fa8259ba4dd0aae

4 years agoMerge "Bind mount install and android writable DATA and OBB dirs" into rvc-dev
TreeHugger Robot [Tue, 21 Apr 2020 11:08:07 +0000 (11:08 +0000)]
Merge "Bind mount install and android writable DATA and OBB dirs" into rvc-dev

4 years agoIntroduce ro.crypto.uses_fs_ioc_add_encryption_key property
Nikita Ioffe [Mon, 20 Apr 2020 21:21:49 +0000 (22:21 +0100)]
Introduce ro.crypto.uses_fs_ioc_add_encryption_key property

Bug: 154327249
Test: adb shell getprop ro.crypto.uses_fs_ioc_add_encryption_key
Test: adb bugreport && checked content contains new property
Change-Id: I562df49deffdccdb2cfd657130fc05b24d40a6a6

4 years agoBind mount install and android writable DATA and OBB dirs
Ricky Wai [Tue, 7 Apr 2020 12:43:20 +0000 (13:43 +0100)]
Bind mount install and android writable DATA and OBB dirs

To improvement performance, and also making them able to list
the dirs.

This should also be fine under b/151055432, as the whole obb
directory is mounted, renameTo() from installer to apps should be
a move not copy.

Bug: 153422990
Bug: 153540919
Test: atest AdoptableHostTest
Change-Id: Ia18fd4393db14a0f11d6e5b947dd716515bdeeef

4 years agoDon't do private app-dir permissions/quota on public volumes.
Martijn Coenen [Mon, 20 Apr 2020 13:14:48 +0000 (15:14 +0200)]
Don't do private app-dir permissions/quota on public volumes.

While looking at some emulator logs, I noticed that we fail to create
dirs like /Android/data/com.foo/cache on public volumes, because we try
to chmod it; public volumes go completely through FUSE, even for
Android/, and so these operations will fail, because the underlying
UID/GID is not setup correctly.

Really the only thing we really have to do on public volumes is create
the dirs, like we used to do.

Bug: 152618535
Test: manually verify cache dirs can be created successfully
Change-Id: I66e5d0873f1198123787943b17b468eadf0a853d

4 years agoRename casefold/projectid properties (for f2fs). am: e9239f757e
Martijn Coenen [Fri, 17 Apr 2020 14:40:56 +0000 (14:40 +0000)]
Rename casefold/projectid properties (for f2fs). am: e9239f757e

Change-Id: I6829424a1ecee05ef8784159789a3a9991d897be

4 years agoRename casefold/projectid properties. am: aee6b6fccd
Martijn Coenen [Fri, 17 Apr 2020 08:10:36 +0000 (08:10 +0000)]
Rename casefold/projectid properties. am: aee6b6fccd

Change-Id: I43a490414c4bd816edb707ba350b4ee151133f8f

4 years agoRename casefold/projectid properties (for f2fs).
Martijn Coenen [Thu, 16 Apr 2020 08:16:29 +0000 (10:16 +0200)]
Rename casefold/projectid properties (for f2fs).

According to property naming guidelines.

Bug: 152170470
Bug: 153525566
Test: N/A
Change-Id: Iad1caff6e5cfb7f6a09b77532d64a24de9b0b3c6

4 years agoRename casefold/projectid properties.
Martijn Coenen [Wed, 15 Apr 2020 09:42:47 +0000 (11:42 +0200)]
Rename casefold/projectid properties.

According to property naming guidelines.

Bug: 152170470
Bug: 153525566
Test: N/A
Change-Id: Iaebff2a835288839a2faf0edbe0e47ceb96b4458
Merged-In: Iaebff2a835288839a2faf0edbe0e47ceb96b4458

4 years agoMerge "Choose options format using property" into rvc-dev am: 0fbd0c1542
TreeHugger Robot [Wed, 8 Apr 2020 00:24:40 +0000 (00:24 +0000)]
Merge "Choose options format using property" into rvc-dev am: 0fbd0c1542

Change-Id: I2d891dd6a28c8f599b68a5df840d0d331fc1c440

4 years agoMerge "Choose options format using property" into rvc-dev
TreeHugger Robot [Wed, 8 Apr 2020 00:10:59 +0000 (00:10 +0000)]
Merge "Choose options format using property" into rvc-dev

4 years agoChoose options format using property
Paul Crowley [Sun, 22 Mar 2020 15:02:06 +0000 (08:02 -0700)]
Choose options format using property

To make it easier to support disk formats created using old versions
of dm-default-key with new kernels, choose the disk format to use
based on options_format_version and first_api_version properties
instead of checking the version number of the kernel module.

Bug: 150761030
Test: crosshatch and cuttlefish boot normally; cuttlefish
    fails with "default-key: Not enough arguments" as expected when
    option is set to 1
Cherry-Picked-From: f56d553babc368e557fe90513e78a5ba06626b0d
Merged-In: Ib51071b7c316ce074de72439741087b18335048c
Change-Id: Ib51071b7c316ce074de72439741087b18335048c

4 years agoAdditional operation check when enabling read logs. am: 605a44fe93
Alex Buynytskyy [Sat, 4 Apr 2020 04:08:31 +0000 (04:08 +0000)]
Additional operation check when enabling read logs. am: 605a44fe93

Change-Id: I6b91438709189302d4afe64d3d5dfe28fadd513d

4 years agoAdditional operation check when enabling read logs.
Alex Buynytskyy [Thu, 2 Apr 2020 22:21:47 +0000 (15:21 -0700)]
Additional operation check when enabling read logs.

Vold now does not check caller's permission, but only accepts
transactions from system_server. And it's up to system server to do the
right thing and check permissions/appops.

Bug: b/152633648
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest
Test: adb shell appops set 1000 GET_USAGE_STATS deny
Change-Id: Id56c1673b135b72b3ec86e572aa4bcca3afc19ab

4 years agoReplace EnsureDirExists with a call to setupAppDir am: 75973cb0dd
Linus Tufvesson [Fri, 3 Apr 2020 13:28:11 +0000 (13:28 +0000)]
Replace EnsureDirExists with a call to setupAppDir am: 75973cb0dd

Change-Id: I58cb29e233e98b588a2e66797bd260b548059ca2

4 years agoReplace EnsureDirExists with a call to setupAppDir
Linus Tufvesson [Mon, 23 Mar 2020 11:59:43 +0000 (11:59 +0000)]
Replace EnsureDirExists with a call to setupAppDir

Test: Manually verified ownership of /storage/emulated/0/Android/data on cf_x86_phone-userdebug after enabling feature
Bug: 151455752

Change-Id: I75a1e3b769476e56094e41d82e7f8e1a72827ded

4 years agoMerge "Checking LOADER_USAGE_STATS before enabling read logs." into rvc-dev am: 6ce90...
Alex Buynytskyy [Thu, 2 Apr 2020 00:48:13 +0000 (00:48 +0000)]
Merge "Checking LOADER_USAGE_STATS before enabling read logs." into rvc-dev am: 6ce90ced12

Change-Id: Ib92de641097b748c417e0d4dfdc21213da7fd789

4 years agoMerge "Checking LOADER_USAGE_STATS before enabling read logs." into rvc-dev
Alex Buynytskyy [Thu, 2 Apr 2020 00:36:26 +0000 (00:36 +0000)]
Merge "Checking LOADER_USAGE_STATS before enabling read logs." into rvc-dev

4 years agoMerge "Send earlyBootEnded notice to all Keymasters" into rvc-dev am: be39b1d53e
TreeHugger Robot [Wed, 1 Apr 2020 22:42:32 +0000 (22:42 +0000)]
Merge "Send earlyBootEnded notice to all Keymasters" into rvc-dev am: be39b1d53e

Change-Id: Ie48c8f230f88cab75c72594269adb1aed7529f3b

4 years agoMerge "Send earlyBootEnded notice to all Keymasters" into rvc-dev
TreeHugger Robot [Wed, 1 Apr 2020 22:31:35 +0000 (22:31 +0000)]
Merge "Send earlyBootEnded notice to all Keymasters" into rvc-dev

4 years agoSend earlyBootEnded notice to all Keymasters
Shawn Willden [Wed, 1 Apr 2020 16:02:16 +0000 (10:02 -0600)]
Send earlyBootEnded notice to all Keymasters

Vold incorrectly sends the earlyBootEnded signal only to the Keymaster
instance used for device encryption, but all of them need it.

Bug: 152932559
Test: VtsHalKeymasterV4_1TargetTest
Change-Id: Id8f01a1dc7d2398395f369c3ea74656a82888829

4 years agoChecking LOADER_USAGE_STATS before enabling read logs.
Alex Buynytskyy [Tue, 31 Mar 2020 21:46:25 +0000 (14:46 -0700)]
Checking LOADER_USAGE_STATS before enabling read logs.

Bug: b/152633648
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest
Change-Id: I29bf16d06a013566c8dd08e64be2a23ad805e37d

4 years agoMerge "Prefer f2fs for virtual (private) storage volumes." into rvc-dev am: 60d7c823ee
TreeHugger Robot [Tue, 31 Mar 2020 11:11:49 +0000 (11:11 +0000)]
Merge "Prefer f2fs for virtual (private) storage volumes." into rvc-dev am: 60d7c823ee

Change-Id: Icf293e9f683a5a24c2c510c2201705c8c898fa88

4 years agoMerge "Prefer f2fs for virtual (private) storage volumes." into rvc-dev
TreeHugger Robot [Tue, 31 Mar 2020 11:00:31 +0000 (11:00 +0000)]
Merge "Prefer f2fs for virtual (private) storage volumes." into rvc-dev

4 years ago[automerger skipped] Block and wait for /dev/block/loop<N> to appear in case it was...
David Anderson [Mon, 30 Mar 2020 09:12:02 +0000 (09:12 +0000)]
[automerger skipped] Block and wait for /dev/block/loop<N> to appear in case it was created asynchronously. am: 5ba8aeaa80 -s ours am: 87bf96a60e -s ours

am skip reason: Change-Id Id8616804bba622226ca21b8eff0d3eb577b4b7e0 with SHA-1 1dd5c4f787 is in history

Change-Id: If9bb43422e10f5c5053f00191b1f1dcec1718aea

4 years ago[automerger skipped] Block and wait for /dev/block/loop<N> to appear in case it was...
David Anderson [Mon, 30 Mar 2020 09:00:04 +0000 (09:00 +0000)]
[automerger skipped] Block and wait for /dev/block/loop<N> to appear in case it was created asynchronously. am: 5ba8aeaa80 -s ours

am skip reason: Change-Id Id8616804bba622226ca21b8eff0d3eb577b4b7e0 with SHA-1 1dd5c4f787 is in history

Change-Id: Iaffd50d7b736066cfa429edf28b3f18fb956715d

4 years ago[vold] update with incfs_ndk.h am: 01c4e91c09
Songchun Fan [Sun, 29 Mar 2020 17:15:00 +0000 (17:15 +0000)]
[vold] update with incfs_ndk.h am: 01c4e91c09

Change-Id: I70d5449b42f1126885582b701bc45d9a501514e8

4 years ago[vold] update with incfs_ndk.h
Songchun Fan [Wed, 4 Mar 2020 01:58:20 +0000 (17:58 -0800)]
[vold] update with incfs_ndk.h

BUG: 150470163
Test: atest PackageManagerShellCommandIncrementalTest
Change-Id: I5166c49cf48f353dab35e385571ada517cb751ac

4 years agoBlock and wait for /dev/block/loop<N> to appear in case it was created asynchronously.
David Anderson [Tue, 11 Jun 2019 21:51:25 +0000 (14:51 -0700)]
Block and wait for /dev/block/loop<N> to appear in case it was created asynchronously.

Bug: 134711825
Bug: 149462396
Test: StorageManagerTest
Change-Id: Id8616804bba622226ca21b8eff0d3eb577b4b7e0
Merged-In: Id8616804bba622226ca21b8eff0d3eb577b4b7e0

4 years ago[vold] Add argument verification to IncFS methods am: 131365a3e5
Yurii Zubrytskyi [Thu, 26 Mar 2020 04:25:16 +0000 (04:25 +0000)]
[vold] Add argument verification to IncFS methods am: 131365a3e5

Change-Id: I149dfdef094804c5eeaa928ee841f7fd7a5f228f

4 years ago[vold] Add argument verification to IncFS methods
Yurii Zubrytskyi [Wed, 25 Mar 2020 06:49:02 +0000 (23:49 -0700)]
[vold] Add argument verification to IncFS methods

+ Get rid of an extra string copy in path validation function

Bug: 152349257
Test: atest vold_tests
Change-Id: I03a8cab0dd6abd7d5c9dcbbc2acb651e818e6cd8

4 years agoRecord use of metadata encryption in property
Paul Crowley [Mon, 23 Mar 2020 15:59:12 +0000 (08:59 -0700)]
Record use of metadata encryption in property

Bug: 152150018
Test: Cuttlefish with and without keydirectory option
Change-Id: I400873ec207cb63f0407fefc83962bb3a927e294

4 years agoMerge "Bind mount Android/data and Android/obb individually." into rvc-dev am: 81872e826c
Martijn Coenen [Tue, 24 Mar 2020 08:50:52 +0000 (08:50 +0000)]
Merge "Bind mount Android/data and Android/obb individually." into rvc-dev am: 81872e826c

Change-Id: I59741944c7731abe21c4b680f496d80beb911a38

4 years agoMerge "Bind mount Android/data and Android/obb individually." into rvc-dev
Martijn Coenen [Tue, 24 Mar 2020 08:31:44 +0000 (08:31 +0000)]
Merge "Bind mount Android/data and Android/obb individually." into rvc-dev

4 years agoMerge "Add quota / casefold options to f2fs if needed." into rvc-dev am: fe6253e3a2
TreeHugger Robot [Fri, 20 Mar 2020 14:48:05 +0000 (14:48 +0000)]
Merge "Add quota / casefold options to f2fs if needed." into rvc-dev am: fe6253e3a2

Change-Id: I7debdd40fc1193146816cb1c54f5a608d5f4af32

4 years agoMerge "Add quota / casefold options to f2fs if needed." into rvc-dev
TreeHugger Robot [Fri, 20 Mar 2020 14:35:07 +0000 (14:35 +0000)]
Merge "Add quota / casefold options to f2fs if needed." into rvc-dev

4 years agoBind mount Android/data and Android/obb individually.
Martijn Coenen [Mon, 16 Mar 2020 13:37:33 +0000 (14:37 +0100)]
Bind mount Android/data and Android/obb individually.

Because we want all other paths (in particular Android/media) to go
through FUSE.

Also use scope_guard to make unwinding some failures easier.

Bug: 151272568
Test: atest AdoptableHostTest
Change-Id: Ib487b9071b5b212c7bb12ce54f80c96d98acaef5

4 years agoFix vold wedge when unmounting Android/ am: b6488f3f04
Zim [Wed, 18 Mar 2020 09:55:29 +0000 (09:55 +0000)]
Fix vold wedge when unmounting Android/ am: b6488f3f04

Change-Id: Idc5260aca207ee933720a7762cf4be9ea1b18686

4 years agoFix vold wedge when unmounting Android/
Zim [Tue, 17 Mar 2020 15:15:42 +0000 (15:15 +0000)]
Fix vold wedge when unmounting Android/

In EmulatedVolume#doMount, if some operations fail, we call
EmulatedVolume#doUnmount.

During this unmount we try to unmount Android/ causing a FUSE_LOOKUP
on the FUSE mount. If the FUSE mount is not up, this can hang.

Now we introduce a new state to prevent unmounting Android/ if it
wasn't mounted.

Test: atest AdoptableHostTest
Bug: 151685786
Change-Id: I6246d3910c352034d2a4fb09ad9c1e7fd91cba5e

4 years agoMake storage dirs remount fork() safe am: 6b12257702
Automerger Merge Worker [Mon, 16 Mar 2020 15:55:40 +0000 (15:55 +0000)]
Make storage dirs remount fork() safe am: 6b12257702

Change-Id: I99fd33c2969236efc8f245aafb55ba4a0d5e9691

4 years agoMake storage dirs remount fork() safe
Ricky Wai [Fri, 28 Feb 2020 16:30:47 +0000 (16:30 +0000)]
Make storage dirs remount fork() safe

Also, use the pids provided by system server to remount all existing
processes, so we don't need to do the heavy and unreliable scanning in
/proc anymore.

Bug: 149548518
Test: atest AdoptableHostTest
Change-Id: Ifb5b79a3bc5438f36e0d61ec8aec96bdbc60ca13

4 years agoPrefer f2fs for virtual (private) storage volumes.
Martijn Coenen [Wed, 11 Mar 2020 14:33:22 +0000 (15:33 +0100)]
Prefer f2fs for virtual (private) storage volumes.

Since ext4 currently doesn't have the required kernel patches in place
on cuttlefish.

Bug: 150935323
Test: sm set-virtual-disk true
      sm partition disk:7,xyz private
      inspect mount output
Change-Id: Ief5bd9ace9d39bdfbae8d3857044a2143801f6be

4 years agoAdd quota / casefold options to f2fs if needed.
Martijn Coenen [Tue, 10 Mar 2020 08:28:39 +0000 (09:28 +0100)]
Add quota / casefold options to f2fs if needed.

These were only added for ext4.

Bug: 150935323
Test: when creating a private f2fs volume, things work as expected.
Change-Id: I11ee04bfddecb6c95e223e66c9bf532c425e6fac

4 years agoMerge "Only set quota project ID inheritance on app-private dirs." into rvc-dev am...
Automerger Merge Worker [Wed, 11 Mar 2020 13:09:25 +0000 (13:09 +0000)]
Merge "Only set quota project ID inheritance on app-private dirs." into rvc-dev am: cbd458bb35

Change-Id: Id8975b6e44e613285467eac8c4156f94fe76fb0d

4 years agoMerge "Only set quota project ID inheritance on app-private dirs." into rvc-dev
TreeHugger Robot [Wed, 11 Mar 2020 12:54:58 +0000 (12:54 +0000)]
Merge "Only set quota project ID inheritance on app-private dirs." into rvc-dev

4 years agoMerge "fskeyring & userspace reboot: support CE keys" into rvc-dev am: 58d89a355a
Automerger Merge Worker [Wed, 11 Mar 2020 12:00:54 +0000 (12:00 +0000)]
Merge "fskeyring & userspace reboot: support CE keys" into rvc-dev am: 58d89a355a

Change-Id: Id2460f313eac688973af9a20b4fc4fddd5cd609a

4 years agoMerge "fskeyring & userspace reboot: support CE keys" into rvc-dev
Nikita Ioffe [Wed, 11 Mar 2020 11:43:30 +0000 (11:43 +0000)]
Merge "fskeyring & userspace reboot: support CE keys" into rvc-dev

4 years agoOnly set quota project ID inheritance on app-private dirs.
Martijn Coenen [Wed, 11 Mar 2020 10:51:45 +0000 (11:51 +0100)]
Only set quota project ID inheritance on app-private dirs.

Previously every directory on external storage had project ID quota
inheritance enabled; this means that if any new file/directory is
created under such a directory, it will inherit the project ID from the
parent. We use a default project ID of 1000 for generic directories, and
application-specific project IDs for app-specific directories.

MediaProvider is responsible for updating the quota type in the generic
directories, as it scans all files there. However, there is a problem
with this approach: if you move a file to a directory with project ID
inheritance set, and the project ID of that file differs from the
project ID of the dir, that results in an EXDEV error, and requires a
copy instead. For example, if /sdcard/DCIM/test.jpg has a project ID of
1003 (for images), and you try to move it to /sdcard/Pictures/test.jpg,
that would require a copy, because the project ID of /sdcard/Pictures is
1000.

While this is not a very common scenario, it's still better to avoid it.
Luckily we can - since MediaProvider anyway scans all files, it will set
the project ID on individual files correctly - there's no need to
inherit them.

We then only need to inherit quota in application-specific directories,
since in those directories the app can create files itself, and those
need to be tagged correctly.

This change enables that, by removing quota inheritance setting from the
top-level directory, and instead doing it for app-specific directories
instead.

Bug: 151078664
Test: atest StorageHostTest
      atest com.android.tests.fused.host.FuseDaemonHostTest#testRenameAndReplaceFile
Change-Id: I38a057ec61cb627e39a3ff7ac58c7218dc251bdc

4 years agofskeyring & userspace reboot: support CE keys
Nikita Ioffe [Fri, 28 Feb 2020 19:50:31 +0000 (19:50 +0000)]
fskeyring & userspace reboot: support CE keys

During userspace reboot /data might be unmounted & remounted, meaning
that CE keys stored in fs-level keyring will be lost. In order to be
able to restore them, when installing new key to fs-level keyring, it's
also added to session-level keyring with type "fscrypt-provisioning".

Then when init_user0 is called during userspace reboot, vold will try to
load CE keys from the session-level keyring back into fs-level keyring
for all the users that were unlocked before the reboot.

If for any user vold fails to install the key, init_user0 will fail and
fallback to hard reboot will be triggered.

Test: set a pin pattern
Test: adb shell setprop sys.init.userdata_remount.force_umount 1
Test: adb shell svc power reboot userspace
Test: atest CtsUserspaceRebootHostSideTestCases
Bug: 143970043
Change-Id: I37603dc136c7ededc7b0381e4d730cb0ffd912b4

4 years agoUse the blk_device supplied by vdc encryptFstab am: 7de5377c89
Automerger Merge Worker [Fri, 6 Mar 2020 01:36:39 +0000 (01:36 +0000)]
Use the blk_device supplied by vdc encryptFstab am: 7de5377c89

Change-Id: I7d25460f5f4333ce9278349dadaa58b09f197c02

4 years agoUse the blk_device supplied by vdc encryptFstab
Paul Crowley [Mon, 2 Mar 2020 20:57:58 +0000 (12:57 -0800)]
Use the blk_device supplied by vdc encryptFstab

fs_mgr may put other dm devices on top of the raw disk, such as for
checkpointing, and it hands metadata encryption the uppermost device in
vdc. That's what should be encrypted, not the raw disk.

Bug: 150354860
Test: Treehugger
Merged-In: I279f087b1b7aded40c5a62281154851ce970ba70
Change-Id: I279f087b1b7aded40c5a62281154851ce970ba70

4 years agoMerge "umount /data/user/0 before umount /data" into rvc-dev am: 16df3dc2b5
Automerger Merge Worker [Thu, 5 Mar 2020 00:36:49 +0000 (00:36 +0000)]
Merge "umount /data/user/0 before umount /data" into rvc-dev am: 16df3dc2b5

Change-Id: I830613a9271a131e555eeb57f6e617053bf1a87a

4 years agoMerge "umount /data/user/0 before umount /data" into rvc-dev
Hung-ying Tyan [Thu, 5 Mar 2020 00:24:34 +0000 (00:24 +0000)]
Merge "umount /data/user/0 before umount /data" into rvc-dev

4 years agoMerge "fskeyring & userspace reboot: support DE keys" into rvc-dev am: e8c7f09834
Automerger Merge Worker [Wed, 4 Mar 2020 12:31:32 +0000 (12:31 +0000)]
Merge "fskeyring & userspace reboot: support DE keys" into rvc-dev am: e8c7f09834

Change-Id: I260d865a5f6954647ea9d7835e45d8219b7de6a3

4 years agoMerge "fskeyring & userspace reboot: support DE keys" into rvc-dev
Nikita Ioffe [Wed, 4 Mar 2020 12:13:55 +0000 (12:13 +0000)]
Merge "fskeyring & userspace reboot: support DE keys" into rvc-dev

4 years agoumount /data/user/0 before umount /data
Hyangseok Chae [Thu, 27 Feb 2020 09:21:50 +0000 (18:21 +0900)]
umount /data/user/0 before umount /data

FDE device has shut down and restart the framework.
But restart is not triggered due to umount fail.
umount /data fail with "device is busy"
It is because bind mount /data/data to /data/user/0

We need umount /data/user/0 before umount /data

Bug: 148004718
Test: Flash GSI and check boot with FDE and FBE device.
Change-Id: I919f9e31a9d2d745b297a7ab99b399aa9b293b39
Merged-In: I919f9e31a9d2d745b297a7ab99b399aa9b293b39
(cherry picked from commit 3cf3233bac176744d43c682b7f9244db58c3402a)

4 years agoAdd Android/data mounting along with obb mounting in vold am: c1e33a3cc9
Automerger Merge Worker [Mon, 2 Mar 2020 13:47:12 +0000 (13:47 +0000)]
Add Android/data mounting along with obb mounting in vold am: c1e33a3cc9

Change-Id: If6b5826c9440e45ff54da90ef5b0ccc34b5edb46

4 years agoAdd Android/data mounting along with obb mounting in vold
Ricky Wai [Thu, 20 Feb 2020 16:10:01 +0000 (16:10 +0000)]
Add Android/data mounting along with obb mounting in vold

We should mount Android/data also, not only Android/obb.

Test: After flag is enabled, AdoptableHostTest still pass.
Bug: 148049767
Bug: 150584566
Change-Id: I26dc3756aa5843b85565495e9c2698130113f49a
Merged-In: I26dc3756aa5843b85565495e9c2698130113f49a
(cherry picked from commit d88e090098d4a95112aecb135d1bcba96150bdd1)

4 years agofskeyring & userspace reboot: support DE keys
Nikita Ioffe [Thu, 27 Feb 2020 18:21:55 +0000 (18:21 +0000)]
fskeyring & userspace reboot: support DE keys

During userspace reboot /data might be unmounted, which means that if
device supports filesystem keyring, DE keys will be lost and are needed
to be re-installed.

Test: adb shell setprop sys.init.userdata_remount.force_umount 1
Test: adb shell svc power reboot userspace
Test: atest CtsUserspaceRebootHostSideTestCases
Bug: 143970043
Change-Id: I153caa1d7c373b3c906a34f1184c681e52854a9d

4 years agoMerge "Switch to new project ID constants."
Martijn Coenen [Thu, 20 Feb 2020 08:58:56 +0000 (08:58 +0000)]
Merge "Switch to new project ID constants."

4 years agoMerge "Make CTS not HEH the default post Q" am: 39969f0288 am: 17d85205bd am: f0bea38daa
Automerger Merge Worker [Thu, 20 Feb 2020 00:22:25 +0000 (00:22 +0000)]
Merge "Make CTS not HEH the default post Q" am: 39969f0288 am: 17d85205bd am: f0bea38daa

Change-Id: I3cf8f261ce7ecf41315ffddbf4964cf47bca1655

4 years agoSwitch to new project ID constants.
Martijn Coenen [Tue, 18 Feb 2020 15:29:25 +0000 (16:29 +0100)]
Switch to new project ID constants.

Use new constants, instead of reusing previous sdcardfs values.

Bug: 146419093
Test: lsattr -pR
Change-Id: I7409d86cac5360e125e843cc79f3c5f41d74dd1e

4 years agoMerge "Make CTS not HEH the default post Q" am: 39969f0288 am: 17d85205bd
Automerger Merge Worker [Wed, 19 Feb 2020 23:37:01 +0000 (23:37 +0000)]
Merge "Make CTS not HEH the default post Q" am: 39969f0288 am: 17d85205bd

Change-Id: I0c3114a77c37b30e542c45fc4d4d6ea592444b1a

4 years agoMerge "Make CTS not HEH the default post Q" am: 39969f0288
Automerger Merge Worker [Wed, 19 Feb 2020 23:20:59 +0000 (23:20 +0000)]
Merge "Make CTS not HEH the default post Q" am: 39969f0288

Change-Id: I0cb0430214ab69656c6e7f3116194b63eb54672b

4 years agoMerge "Make CTS not HEH the default post Q"
Treehugger Robot [Wed, 19 Feb 2020 23:04:37 +0000 (23:04 +0000)]
Merge "Make CTS not HEH the default post Q"

4 years agoMerge "Fix unaligned access to auth token user_id" am: 21a17b091e am: 01759662fd...
Automerger Merge Worker [Wed, 19 Feb 2020 22:20:32 +0000 (22:20 +0000)]
Merge "Fix unaligned access to auth token user_id" am: 21a17b091e am: 01759662fd am: 7b9b164946

Change-Id: Ibe10561445571d7607ea93d7a988a9ab847e234a

4 years agoMerge "Remove unused code in VoldUtil.h" am: e19189bd7f am: b6421644ec am: 923309aae2
Automerger Merge Worker [Wed, 19 Feb 2020 22:19:46 +0000 (22:19 +0000)]
Merge "Remove unused code in VoldUtil.h" am: e19189bd7f am: b6421644ec am: 923309aae2

Change-Id: I0ec249df609cbad7f80ac739545c6cf0199e6232

4 years agoMerge changes from topics "metadata_wrapped_key_aosp", "volume_metadata" am: 36fd1ebf...
Automerger Merge Worker [Wed, 19 Feb 2020 22:19:26 +0000 (22:19 +0000)]
Merge changes from topics "metadata_wrapped_key_aosp", "volume_metadata" am: 36fd1ebfae am: 6891eb7e2d am: c14f46d114

Change-Id: I89f51bfaeb61c235aeccbe8a5a5a447ab14c46cb

4 years agoMerge "Mount direct boot apps obb dir after fuse is ready."
Ricky Wai [Wed, 19 Feb 2020 19:42:13 +0000 (19:42 +0000)]
Merge "Mount direct boot apps obb dir after fuse is ready."

4 years agoMake CTS not HEH the default post Q
Paul Crowley [Tue, 18 Feb 2020 18:10:08 +0000 (10:10 -0800)]
Make CTS not HEH the default post Q

Making HEH the default was always a mistake and a giant foot-gun.
Let's make life easier for people by making the default depend on
first_api_level, so it's automatically set up right for new devices
without breaking old ones. Also use v2 fscrypt keys instead of v1 post
Q.

Bug: 147107322
Test: Various Cuttlefish configurations
Change-Id: I5432bdfd6fec6ed34e7f9ab7cdd32cdeb2a03472

4 years agoMount direct boot apps obb dir after fuse is ready.
Ricky Wai [Tue, 11 Feb 2020 14:31:24 +0000 (14:31 +0000)]
Mount direct boot apps obb dir after fuse is ready.

- Remove bind mounting Android/ code as we want to bind mount obb dir
for each process instead.
- Set property "vold.vold.fuse_running_users" as an array of user id
for which fuse is ready to use.
- After fuse is ready for a user, fork a background process in vold
to bind mount all direct boot apps for that user so its direct boot
apps obb dir will be mounted to lower fs for imporoved performance.

Bug: 148049767
Bug: 137890172
Test: After flag is enabled, AdoptableHostTest still pass.
Change-Id: I90079fbeed1c91f9780ca71e37b0012884680b7c

4 years agoAdd fixupAppDir() API.
Martijn Coenen [Tue, 18 Feb 2020 14:06:37 +0000 (15:06 +0100)]
Add fixupAppDir() API.

This can be used to fixup application directories in case they have been
created by some other entity besides vold; the main use case for this
API right now is OBB directories, which can be created by installers
outside of vold; on devices without sdcardfs, such directories and the
files contained therein are not setup correctly. This API will make sure
everything is setup the way it needs to be setup.

Bug: 146419093
Test: inspect OBB dir after install
Change-Id: I2e35b7ac2992dbb21cc950e53651ffc07cfca907

4 years agoMerge "Fix unaligned access to auth token user_id" am: 21a17b091e am: 01759662fd
Automerger Merge Worker [Wed, 19 Feb 2020 00:06:04 +0000 (00:06 +0000)]
Merge "Fix unaligned access to auth token user_id" am: 21a17b091e am: 01759662fd

Change-Id: I224885ade242636a9806574c164f34494a8f377f