Commit graph

3753 commits

Author SHA1 Message Date
Alistair Delva
ea97154183 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
Merged-In: I0b41670d5f76b2506dad437917c2276f8e0aaccf
2020-05-20 00:45:02 +00:00
Alistair Delva
c671731075 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
2020-05-19 17:42:20 -07:00
Paul Crowley
b2c448fa6d Merge "Record use of metadata encryption in property" into rvc-dev am: 09ff429e2a
Change-Id: I2e39a3e24ea8bf488ffb8e901fa6449175673b5c
2020-05-19 23:12:25 +00:00
Paul Crowley
09ff429e2a Merge "Record use of metadata encryption in property" into rvc-dev 2020-05-19 22:59:13 +00:00
Treehugger Robot
7c39a18450 [automerger skipped] Merge "Expand virtio_block check to other virtual devices" am: ff9975c04f am: edb596fc36 -s ours
am skip reason: Change-Id Ieae805d08fddd0124a397636f04d99194a9ef7e5 with SHA-1 ff1fc9bc41 is in history

Change-Id: I8e4c5e3a044f8305dd29820709e073687991e559
2020-05-16 05:27:30 +00:00
Treehugger Robot
edb596fc36 Merge "Expand virtio_block check to other virtual devices" am: ff9975c04f
Change-Id: Ic604273ddef8ac356e1e23fba050da7d68a24871
2020-05-16 05:13:11 +00:00
Treehugger Robot
ff9975c04f Merge "Expand virtio_block check to other virtual devices" 2020-05-16 04:51:28 +00:00
Alistair Delva
7034b8a926 Expand virtio_block check to other virtual devices am: ff1fc9bc41
Change-Id: I679b9ab19d470a14e2708afd9078f2cff599b3b6
2020-05-16 01:48:06 +00:00
Alistair Delva
d3c230b5c9 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
Merged-In: Ieae805d08fddd0124a397636f04d99194a9ef7e5
2020-05-16 00:02:21 +00:00
Alistair Delva
ff1fc9bc41 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
2020-05-15 17:00:44 -07:00
TreeHugger Robot
a217c25939 Merge "Mount storage Android/data and Android/obb as tmpfs in app namespace" into rvc-dev am: dbc0da396a
Change-Id: I0efd4541ccb6ce75bcb887c03f516b7b6ce41acc
2020-05-13 14:27:28 +00:00
TreeHugger Robot
dbc0da396a Merge "Mount storage Android/data and Android/obb as tmpfs in app namespace" into rvc-dev 2020-05-13 14:17:04 +00:00
Satoshi Niwa
c0cc8d0322 Revert "ARC++ swap for AppFuseUtil" am: 58d4044082
Change-Id: I82771efbb0ab25327fca3ffac9f77c3e126bf989
2020-05-13 14:01:23 +00:00
Satoshi Niwa
58d4044082 Revert "ARC++ swap for AppFuseUtil"
This reverts commit ab7c958cc5.

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

Bug: 110379912
Test: m
Change-Id: Icc827c59530274421e4c94789d96fd3d287e591e
2020-05-12 14:43:42 +00:00
Treehugger Robot
bcbd085191 Merge "Revert "ARC++ swap for AppFuseUtil"" am: b6e2c14ed1 am: 4cf8ddeed2
Change-Id: I8d91ba35477d526ff886ed32c7c1357134dfca4d
2020-05-12 13:00:16 +00:00
Treehugger Robot
4cf8ddeed2 Merge "Revert "ARC++ swap for AppFuseUtil"" am: b6e2c14ed1
Change-Id: I3545346238ddaaec8c1a947f00aaeadd12dfd63b
2020-05-12 12:46:32 +00:00
Treehugger Robot
b6e2c14ed1 Merge "Revert "ARC++ swap for AppFuseUtil"" 2020-05-12 12:30:16 +00:00
Satoshi Niwa
601e7bd4e2 Revert "ARC++ swap for AppFuseUtil"
This reverts commit dcbd4fcad2.

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

Change-Id: Ifd0bf92a79c0ff25d782bea44dd593f9502f1959
2020-05-08 04:50:34 +00:00
Ricky Wai
e96b34fe82 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
2020-05-07 16:01:33 +01:00
Treehugger Robot
93dcfef249 Merge "Acknowledge the 'nofail' fs_mgr flag and skip the expected failure." am: e8acc83d25 am: 3a149b6735
Change-Id: Icb1ef75616ebc3bfe3f1e71a93ca25b42cb348ae
2020-05-06 17:39:50 +00:00
Treehugger Robot
3a149b6735 Merge "Acknowledge the 'nofail' fs_mgr flag and skip the expected failure." am: e8acc83d25
Change-Id: I1fb2dbb0de98e3e2deadce25183aa37f2bc7c4ba
2020-05-06 17:22:38 +00:00
Treehugger Robot
e8acc83d25 Merge "Acknowledge the 'nofail' fs_mgr flag and skip the expected failure." 2020-05-06 17:02:43 +00:00
P.Adarsh Reddy
167c2a658a Acknowledge the 'nofail' fs_mgr flag and skip the expected failure.
fs_mgr supports 'nofail' flag, which is used if we do not want to
error-out incase the mounting/setup fails for a partition tagged with
nofail flag in fstab.

Recently added code in vold misses this handling, i.e. it aborts even
for a nofail partition upon encountering an expected failure.

Test: Add a non-existing logical partition fstab entry with 'nofail'
      flag. Init's first stage mount acks this and doesn't crash.
      Vold aborts (as it doesn't handle it), and device doesn't boot.
      With this change, device boots up.

Change-Id: I2b1904a9c648c31bcc05b2e7e77480db236ff66e
2020-05-06 16:45:23 +00:00
Martijn Coenen
82fddb072e Introduce postMount() VolumeBase helper. am: 5ec8658abc
Change-Id: Ia2bd24b550bc9b9d3c942f4bbbd08322cb26141f
2020-05-06 09:30:46 +00:00
Martijn Coenen
5ec8658abc 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
2020-05-04 15:09:32 +02:00
Treehugger Robot
01b59992b1 Merge "vold: fix missing has.adoptable" am: 9e2053e185 am: d4e75c211d
Change-Id: I7734099f9c1cd88c9577542684402efb8f095107
2020-04-23 22:52:12 +00:00
Treehugger Robot
d4e75c211d Merge "vold: fix missing has.adoptable" am: 9e2053e185
Change-Id: I3f87b104678fb57c627165fcd5faea846e25d343
2020-04-23 22:36:56 +00:00
Treehugger Robot
9e2053e185 Merge "vold: fix missing has.adoptable" 2020-04-23 22:15:38 +00:00
Yurii Zubrytskyi
20d7fc9160 [incfs] Use new IncFs_ReleaseControlFds() instead of duping am: fc7b6697b4
Change-Id: I808d898afe636a206518db413ff1abf3cc6d0e6d
2020-04-23 21:56:14 +00:00
Jaegeuk Kim
4ea573aca7 vold: fix missing has.adoptable
This patch fixes missing entry in the below commit.

Fixes: c52f6724ed ("vold: clean up configuration set")
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: Ia39a427d4747b29a7af42633f34daab63204bbf9
2020-04-23 13:43:12 -07:00
Yurii Zubrytskyi
fc7b6697b4 [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
2020-04-22 23:26:32 -07:00
Treehugger Robot
bcbddda15a [automerger skipped] Merge "Introduce ro.crypto.uses_fs_ioc_add_encryption_key property" am: 83c78a2bb1 am: ebcd59d19b -s ours
am skip reason: Change-Id I562df49deffdccdb2cfd657130fc05b24d40a6a6 with SHA-1 78f806198f is in history

Change-Id: Ib183a53d8b49427ddf243d22db5df1f4b2b9815e
2020-04-21 16:20:32 +00:00
Treehugger Robot
ebcd59d19b Merge "Introduce ro.crypto.uses_fs_ioc_add_encryption_key property" am: 83c78a2bb1
Change-Id: Icfcf0222bd97d52d6fed2eeef3c3fca335d8b93e
2020-04-21 16:07:15 +00:00
Treehugger Robot
83c78a2bb1 Merge "Introduce ro.crypto.uses_fs_ioc_add_encryption_key property" 2020-04-21 15:51:20 +00:00
Nikita Ioffe
c1dce0695b Merge "Introduce ro.crypto.uses_fs_ioc_add_encryption_key property" into rvc-dev am: 4e1e7ef09a
Change-Id: I6c88e5725a1e8ed3300bfeda5bed26b0c8875e72
2020-04-21 14:44:48 +00:00
Nikita Ioffe
eea8bd39a2 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
Merged-In: I562df49deffdccdb2cfd657130fc05b24d40a6a6
(cherry picked from commit 78f806198f)
2020-04-21 15:28:41 +01:00
Nikita Ioffe
4e1e7ef09a Merge "Introduce ro.crypto.uses_fs_ioc_add_encryption_key property" into rvc-dev 2020-04-21 14:27:18 +00:00
Martijn Coenen
9c306323e2 Merge "Don't do private app-dir permissions/quota on public volumes." into rvc-dev am: 15070b1833
Change-Id: Ibc6535772cd77c1f68c380e0993f79fdacca55e1
2020-04-21 12:42:22 +00:00
Martijn Coenen
15070b1833 Merge "Don't do private app-dir permissions/quota on public volumes." into rvc-dev 2020-04-21 12:22:58 +00:00
TreeHugger Robot
92cd800665 Merge "Bind mount install and android writable DATA and OBB dirs" into rvc-dev am: 086c96ef6d
Change-Id: I288fc55dffe20f273be3e74e4fe4d69b29d13da0
2020-04-21 11:25:16 +00:00
TreeHugger Robot
086c96ef6d Merge "Bind mount install and android writable DATA and OBB dirs" into rvc-dev 2020-04-21 11:08:07 +00:00
Nikita Ioffe
78f806198f 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
2020-04-20 22:21:49 +01:00
Ricky Wai
ef63921f81 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
2020-04-20 15:06:58 +01:00
Martijn Coenen
bf205ab7d4 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
2020-04-20 15:20:09 +02:00
Martijn Coenen
c41ac2f3d7 Rename casefold/projectid properties (for f2fs). am: e9239f757e
Change-Id: Ib895adcd495dd3dc4e9d675d1990d04b173a1b14
2020-04-17 14:41:07 +00:00
Martijn Coenen
d4de3bd143 [automerger skipped] Rename casefold/projectid properties. am: aee6b6fccd -s ours
am skip reason: Change-Id Iaebff2a835288839a2faf0edbe0e47ceb96b4458 with SHA-1 97ff0845e2 is in history

Change-Id: If48e613ce1fba64f6bf9bf8613ce93d76cf8b31f
2020-04-17 08:10:15 +00:00
Martijn Coenen
729c26033e Merge "Rename casefold/projectid properties." am: 9d0508a854 am: 5901d6f492
Change-Id: Ic9982c15351008ff686f9bf395ae8f3b4adcdb30
2020-04-16 08:35:08 +00:00
Martijn Coenen
5901d6f492 Merge "Rename casefold/projectid properties." am: 9d0508a854
Change-Id: If27cbdd3df8bb53b8e27a772be9b0826a8fce4e4
2020-04-16 08:21:00 +00:00
Martijn Coenen
e9239f757e Rename casefold/projectid properties (for f2fs).
According to property naming guidelines.

Bug: 152170470
Bug: 153525566
Test: N/A
Change-Id: Iad1caff6e5cfb7f6a09b77532d64a24de9b0b3c6
2020-04-16 10:18:36 +02:00
Martijn Coenen
aee6b6fccd Rename casefold/projectid properties.
According to property naming guidelines.

Bug: 152170470
Bug: 153525566
Test: N/A
Change-Id: Iaebff2a835288839a2faf0edbe0e47ceb96b4458
Merged-In: Iaebff2a835288839a2faf0edbe0e47ceb96b4458
2020-04-16 10:18:30 +02:00