Commit graph

3616 commits

Author SHA1 Message Date
Nikita Ioffe
ee31d7a050 Merge "Configure read ahead for fuse mounts" into rvc-dev am: bcd7d5e7ce am: 7e29904e8c
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/11837171

Change-Id: Ia366a51e037bebda0d828b17eade626b91a9bf68
2020-06-17 17:12:05 +00:00
Nikita Ioffe
7e29904e8c Merge "Configure read ahead for fuse mounts" into rvc-dev am: bcd7d5e7ce
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/11837171

Change-Id: I16f0f0b5925c503c66d1d7b14687232b9c30f782
2020-06-17 16:53:01 +00:00
Nikita Ioffe
bcd7d5e7ce Merge "Configure read ahead for fuse mounts" into rvc-dev 2020-06-17 16:37:37 +00:00
Nikita Ioffe
dcee5c1d21 Configure read ahead for fuse mounts
For fuse read ahead can be configured by writing a value to the
/sys/class/bdi/{MAJOR}:{MINOR}/read_ahead_kb file.

There are several different ways of getting {MAJOR}:{MINOR} values of
the filesystem:

* Look at st_dev of stat("/mnt/user/0/emulated").
* Parse /proc/self/mountinfo.

Stat'ing approach is used since it's easier to implement.

Bug: 157982297
Test: atest vold_tests
Test: adb shell cat /proc/self/mountinfo to get MAJOR:MINOR
Test: adb shell cat /sys/class/bdi/{MAJOR}:{MINOR}/read_ahead_kb
Test: created public volume, checked it's read_ahead_kb is also 256
Change-Id: Id0c149c4af1ceabf3afc33b4100563a512b38316
2020-06-17 15:58:25 +01:00
Martijn Coenen
c5ce51cc7c Add app's own UID to the default ACL. am: 1129b81071 am: 55565a991f
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/11871333

Change-Id: I12878459555339919d8696da80df67e45a138ceb
2020-06-17 07:16:58 +00:00
Martijn Coenen
55565a991f Add app's own UID to the default ACL. am: 1129b81071
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/11871333

Change-Id: Icff0c7db7e572aedb6da75c38bdea08c204e087e
2020-06-17 07:01:53 +00:00
Martijn Coenen
1129b81071 Add app's own UID to the default ACL.
On devices without sdcardfs, /Android/data/com.foo and
/Android/obb/com.foo can be written by other processes (eg installers);
in those cases, file ownership may be wrong. To ensure that the original
app always has access to the files contained in this directory, add a
group to the default ACL that matches the UID of the app. Since all apps
have their own UID also as their group ID, this ensures that things keep
working correctly.

Bug: 157530951
Test: atest
android.appsecurity.cts.ExternalStorageHostTest#testExternalStorageUnsharedObb
Change-Id: I829a2a7c7b578a8328643f38681e68796adcd6b2

Change-Id: Ibbc333fb395507363830dfcf5dc6f1cfd55f008d
2020-06-16 15:16:18 +02:00
Martijn Coenen
59339e5c62 Merge "vold: Support aborting FUSE connections." into rvc-dev am: cbb69e548a am: 8714d59e29
Change-Id: I91c1b387d8cf5967fa3ad412ca7453364668d812
2020-05-29 16:15:08 +00:00
Martijn Coenen
8714d59e29 Merge "vold: Support aborting FUSE connections." into rvc-dev am: cbb69e548a
Change-Id: I587b49c9baed58fb87d27e060faf5d3d4ef8d788
2020-05-29 15:59:55 +00:00
Martijn Coenen
cbb69e548a Merge "vold: Support aborting FUSE connections." into rvc-dev 2020-05-29 15:47:05 +00:00
Abhijeet Kaur
836430b5e0 FuseDaemonHostTest is migrated to CTS and renamed. am: de83802e41 am: 13bfc2465c
Change-Id: I1419edbe7c7004cee2cdb14bb5861d07e39d7b2f
2020-05-29 15:18:56 +00:00
Abhijeet Kaur
13bfc2465c FuseDaemonHostTest is migrated to CTS and renamed. am: de83802e41
Change-Id: Iebe048b3e1dd31a63ed62df8c2010e9e5d5d5e4a
2020-05-29 15:06:57 +00:00
Abhijeet Kaur
de83802e41 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
2020-05-28 18:43:08 +01:00
Martijn Coenen
23c0445355 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
2020-05-28 16:07:16 +02:00
Daniel Rosenberg
82b2e7f6a0 Move enabling sdcardfs behind a property am: f36bdddc7e am: 09daf93c62
Change-Id: Iaf328bd2731b680a0da9d66555c0ed7ea5b01b7a
2020-05-21 09:01:53 +00:00
Daniel Rosenberg
09daf93c62 Move enabling sdcardfs behind a property am: f36bdddc7e
Change-Id: I6ded03167243e9fc60dc2206b5781a84a0140aa3
2020-05-21 08:41:18 +00:00
Daniel Rosenberg
f36bdddc7e 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
2020-05-19 22:11:49 -07:00
TreeHugger Robot
f7c0f602d3 Merge "Handle virtio in private fs mapping" into rvc-dev am: 0d1fcb90d6 am: 34d72f126b
Change-Id: I42ca63f91246d722681fc56aaf2a5e125eaf26eb
2020-05-20 05:00:00 +00:00
TreeHugger Robot
34d72f126b Merge "Handle virtio in private fs mapping" into rvc-dev am: 0d1fcb90d6
Change-Id: I11bc694a26676dd9f8b0fda7f2078a9bc6ed8719
2020-05-20 04:44:11 +00:00
TreeHugger Robot
0d1fcb90d6 Merge "Handle virtio in private fs mapping" into rvc-dev 2020-05-20 04:28:31 +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
60409ffd37 Merge "Record use of metadata encryption in property" into rvc-dev am: 09ff429e2a am: 4ca39e4b56
Change-Id: Idaabb296a7c600dcf8d4798a3687e43788e9f00d
2020-05-19 23:33:14 +00:00
Paul Crowley
4ca39e4b56 Merge "Record use of metadata encryption in property" into rvc-dev am: 09ff429e2a
Change-Id: I75726c747937654cdaea15e299cedf0f72c7c5a5
2020-05-19 23:12:02 +00:00
Paul Crowley
09ff429e2a Merge "Record use of metadata encryption in property" into rvc-dev 2020-05-19 22:59:13 +00:00
Alistair Delva
af7446f213 Expand virtio_block check to other virtual devices am: ff1fc9bc41 am: ac8027eed5
Change-Id: I3000836ad273d36434a2f191d5d96571cc842faa
2020-05-16 02:06:11 +00:00
Alistair Delva
ac8027eed5 Expand virtio_block check to other virtual devices am: ff1fc9bc41
Change-Id: I2eda581574e0adecf1617624a66af92b540c35c4
2020-05-16 01:47:58 +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
0cadfb3b15 Merge "Mount storage Android/data and Android/obb as tmpfs in app namespace" into rvc-dev am: dbc0da396a am: 08b5b882d6
Change-Id: I71baa4daf12d0d54ec2cb25f8c8a2391cbd6d421
2020-05-13 14:47:51 +00:00
TreeHugger Robot
08b5b882d6 Merge "Mount storage Android/data and Android/obb as tmpfs in app namespace" into rvc-dev am: dbc0da396a
Change-Id: Ib19a8ab5fc09b138b2dae8b1db2003127d277f10
2020-05-13 14:27:17 +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
eeaa263f2f Revert "ARC++ swap for AppFuseUtil" am: 58d4044082 am: 198657d332
Change-Id: I6490832022117fa575263cd5ec52488b9e17ea1b
2020-05-13 14:16:54 +00:00
Satoshi Niwa
198657d332 Revert "ARC++ swap for AppFuseUtil" am: 58d4044082
Change-Id: I46e6d976324d956b1ad173ba8ed97de760999451
2020-05-13 14:00:54 +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
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
Martijn Coenen
e55c8f6ae7 Introduce postMount() VolumeBase helper. am: 5ec8658abc am: 2e05806850
Change-Id: I8fa1780662fd27adbb5729fdc89b06d8db545df5
2020-05-06 09:44:18 +00:00
Martijn Coenen
2e05806850 Introduce postMount() VolumeBase helper. am: 5ec8658abc
Change-Id: Id8ce7dbaabafef41121dbdf9f6169f1377ae1174
2020-05-06 09:29:56 +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
Yurii Zubrytskyi
61dad64ea0 [incfs] Use new IncFs_ReleaseControlFds() instead of duping am: fc7b6697b4 am: 12ffb988c2
Change-Id: Ie9a92124bdcc16dc854390d57dcbb22723b1f0c8
2020-04-23 22:10:49 +00:00
Yurii Zubrytskyi
12ffb988c2 [incfs] Use new IncFs_ReleaseControlFds() instead of duping am: fc7b6697b4
Change-Id: Ieff848e641fe40d7a199e460f327ef8aba041dae
2020-04-23 21:56:23 +00: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
Nikita Ioffe
1486b0d935 Merge "Introduce ro.crypto.uses_fs_ioc_add_encryption_key property" into rvc-dev am: 4e1e7ef09a am: a2596ddf5e
Change-Id: I5a0f8fcbbb32ee4f2390af15659b55575d2afa43
2020-04-21 14:56:54 +00:00
Nikita Ioffe
a2596ddf5e Merge "Introduce ro.crypto.uses_fs_ioc_add_encryption_key property" into rvc-dev am: 4e1e7ef09a
Change-Id: I1d4f16c45ac8082ae5c6aa7216a4636a32e0c0b7
2020-04-21 14:44:12 +00: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
94bd48de35 Merge "Don't do private app-dir permissions/quota on public volumes." into rvc-dev am: 15070b1833 am: fcabee6875
Change-Id: Ife40fbf8b0f2d17f73babe90cb0cf2e422dd2091
2020-04-21 12:56:33 +00:00
Martijn Coenen
fcabee6875 Merge "Don't do private app-dir permissions/quota on public volumes." into rvc-dev am: 15070b1833
Change-Id: I5b5d4b3f8b8b3ed94264eb79261097b1b93f53a2
2020-04-21 12:41:54 +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
7cbefff786 Merge "Bind mount install and android writable DATA and OBB dirs" into rvc-dev am: 086c96ef6d am: 95d66bc103
Change-Id: Iebb0ce17064b3441aabfcdc45d66639fa3f36f01
2020-04-21 11:30:44 +00:00
TreeHugger Robot
95d66bc103 Merge "Bind mount install and android writable DATA and OBB dirs" into rvc-dev am: 086c96ef6d
Change-Id: I227d66a376dad24ca40612849fa8259ba4dd0aae
2020-04-21 11:24:14 +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