Commit graph

5005 commits

Author SHA1 Message Date
Yurii Zubrytskyi
18eb877246 [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

Bug: 198657657
Bug: 216722132
Test: manual
Change-Id: I6035447f94ef44c4ae3294c3ae47de2d7210683a
Merged-In: I6035447f94ef44c4ae3294c3ae47de2d7210683a
2022-01-31 22:13:14 +00:00
Treehugger Robot
313e8556a6 Merge "Add timeout for fsck on untrusted media" 2022-01-26 08:55:08 +00:00
Tao Wu
09997fe28a Merge "Don't abort fuse connections for virtiofs." 2022-01-19 03:57:44 +00:00
Tao Wu
3d98962269 Don't abort fuse connections for virtiofs.
Android should only abort fuse connections for fuse fs. It shouldn't
touch fuse connections for virtiofs.

Bug: 162284193
Test: manual - Restart zygote, no 'Transport endpoint is not connected' error.
Change-Id: Ie3536734531404e98ad1b6594ab3c52e919b22b7
2022-01-18 18:33:52 -08:00
Daeho Jeong
6845e06ab9 Merge "Add interfaces required by smart idle maintenance service" 2022-01-13 16:38:04 +00:00
Daeho Jeong
999fceb07c Add interfaces required by smart idle maintenance service
Added interfaces required by smart idle maintenance service in
StorageManagerService, whose goal is to determine when to trigger
filesystem defragmentation while keeping the best user experience
as long as possible, and avoiding hurting UFS lifetime.

Test: check smart idle maintenance log every hour
Bug: 202283480
Bug: 181079477
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Change-Id: I012cfb9b01e5d21ec71700c3c52ac9c096cd1a90
2022-01-12 10:54:37 -08:00
Treehugger Robot
df2bc1025b Merge "MetadataCrypt: fix timeout due to missing userdata dm device" 2021-12-24 00:42:51 +00:00
Will McVicker
b910e7e325 MetadataCrypt: fix timeout due to missing userdata dm device
We need to load the partition table before we can wait on the userdata
dm device because the kernel (as of [1] doesn't send the KOBJ_ADD uevent
until after the partition table is loaded. The new flow needs to be:

  CreateDevice() -> ioctl(DM_DEV_CREATE)
  LoadTableAndActivate() -> ioctl(DM_TABLE_LOAD)
  WaitForDevice()

This patch updates create_crypto_blk_dev() to first call
LoadTableAndActivate() before WaitForDevice().

[1] https://lore.kernel.org/all/20210804094147.459763-8-hch@lst.de/

Fixes: 156d9d2293 ("Pre-create userdata metadata encryption device.")
Bug: 210737958
Test: manually test booting raven with android13-5.15
Change-Id: Iab2214a62d44ba7e53b57f2cf0f08ac06c77b4fd
2021-12-23 20:36:44 +00:00
Xin Li
235d1d65f8 Merge "Merge Android 12 QPR1" 2021-12-14 20:25:23 +00:00
Xin Li
721a879cfe Merge Android 12 QPR1
Bug: 210511427
Merged-In: Id6edfe90aadae4db1b23c5bc0de4981170ba42f2
Change-Id: Ic9e9149ae767b55c33b100586dfcb5790c862bbf
2021-12-14 08:39:19 -08:00
Treehugger Robot
344c737ba0 Merge "Remove StubVolume disks upon vold reset events" am: e8d0e486a3
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1902674

Change-Id: Id6edfe90aadae4db1b23c5bc0de4981170ba42f2
2021-12-08 08:43:32 +00:00
Treehugger Robot
e8d0e486a3 Merge "Remove StubVolume disks upon vold reset events" 2021-12-08 08:25:46 +00:00
Youkichi Hosoi
dfaff1dc15 Remove StubVolume disks upon vold reset events
StubVolumes are managed from outside Android (e.g. from Chrome OS). So,
their disk recreation on vold reset events should also be handled from
outside by 1) listening to reset events, and 2) calling
createStubVolume() for existing StubVolumes on reset events.

Bug: 175281783
Test: m
Test: (Tested in R) Manually induce a vold reset event, and confirm that
Test: 1) vold does not crash, and 2) existing volumes are successfully
Test: mounted again (by calling createStubVolume() for StubVolumes).
Change-Id: I4628eabf809037a547aeef43faedf4dfa57529a6
2021-12-08 09:37:53 +09:00
Treehugger Robot
64a5600c83 Merge "Depend on Keystore2 AIDL via default" am: b9f8c322c7
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1906281

Change-Id: I6383e6a45086539103bae5f19369532733d4aec5
2021-12-07 18:21:50 +00:00
Treehugger Robot
b9f8c322c7 Merge "Depend on Keystore2 AIDL via default" 2021-12-07 18:08:13 +00:00
Treehugger Robot
f0bde5767c Merge "Disable bind mounts for data and obb if FUSE BPF is available" am: b9f8aefbb9
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1907695

Change-Id: I6867f9941c2e98023999b11edf5d0e2f67949840
2021-12-02 20:34:59 +00:00
Treehugger Robot
b9f8aefbb9 Merge "Disable bind mounts for data and obb if FUSE BPF is available" 2021-12-02 19:54:26 +00:00
Alessio Balsini
dd1e91ff58 Disable bind mounts for data and obb if FUSE BPF is available
FUSE BPF aims at achieving comparable performance to bind-mounts, with
the flexibility of FUSE.
Disable data and obb bind-mounts in favor of the FUSE filesystem if the
system implements the feature.

Bug: 202785178
Test: mount | grep obb
Signed-off-by: Alessio Balsini <balsini@google.com>
Change-Id: Ia8b289b84542125831a857b559bb6f93afbee494
2021-12-02 18:35:17 +00:00
David Drysdale
4babbc78d5 Depend on Keystore2 AIDL via default
This allows for easier bumping of the KeyMint/Keystore2 version level.

At the moment this change should have no effect: the same dependency
is used, just reached via a default rather than explicitly.

However, when the Keystore2 version increases in the near future, using
this default should mean that no change is needed here: the default
definition will change to -V2 and this will be referenced here.

Test: TreeHugger
Change-Id: I7cec2cd8fac137e5ac7e95db06e738e94a3cc567
2021-12-01 09:56:48 +00:00
Paul Lawrence
cca6366ead Merge "Add dependency for vold on fuse_media.o" am: e9c951590e
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1894199

Change-Id: I0578842564cc92860548f895498c7e852e853166
2021-11-29 16:33:03 +00:00
Paul Lawrence
e9c951590e Merge "Add dependency for vold on fuse_media.o" 2021-11-29 16:18:42 +00:00
Treehugger Robot
6e9d37542f Merge "Split MOUNT_FLAG_VISIBLE into MOUNT_FLAG_VISIBLE_FOR_{READ, WRITE}" am: bddb449182
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1891635

Change-Id: I9b8c755cacecd71598ec48ac5d009a0aa728e3de
2021-11-26 03:23:23 +00:00
Treehugger Robot
bddb449182 Merge "Split MOUNT_FLAG_VISIBLE into MOUNT_FLAG_VISIBLE_FOR_{READ, WRITE}" 2021-11-26 03:02:16 +00:00
Youkichi Hosoi
2991cbe49f Split MOUNT_FLAG_VISIBLE into MOUNT_FLAG_VISIBLE_FOR_{READ, WRITE}
IVold.MOUNT_FLAG_VISIBLE is split into MOUNT_FLAG_VISIBLE_FOR_READ and
MOUNT_FLAG_VISIBLE_FOR_WRITE.
Accordingly, VolumeBase::MountFlags::kVisible is split into
kVisibleForRead and kVisibleForWrite.

Bug: 206019156
Test: m
Change-Id: Ia55673400d9f713f221650e1335a46ba11f6f027
Merged-In: Ia55673400d9f713f221650e1335a46ba11f6f027
2021-11-25 13:04:45 +09:00
Eric Biggers
56e5978547 Merge "Allow IV_INO_LBLK_32 with virtio storage" am: 660f052858
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1899590

Change-Id: Iada10c8ad80a70a039354e8321153c0cad4bd785
2021-11-23 19:10:20 +00:00
Eric Biggers
660f052858 Merge "Allow IV_INO_LBLK_32 with virtio storage" 2021-11-23 18:48:11 +00:00
Eric Biggers
f9c6dfa8fd Allow IV_INO_LBLK_32 with virtio storage
This has to be allowed as a workaround until there is a way for
userspace to check the maximum DUN size directly.

Bug: 207390665
Change-Id: Id5e51720ca963fe80e65dbae1965f777b3cd2ee4
2021-11-22 11:33:39 -08:00
Xin Li
d756848928 Merge "Merge sc-qpr1-dev-plus-aosp-without-vendor@7810918" into stage-aosp-master 2021-11-18 21:29:02 +00:00
Paul Lawrence
5defbf9607 Add dependency for vold on fuse_media.o
Ensure fuse_media gets included in every build

Bug: 202785178
Test: /system/etc/bpf/fuse_media.o is present

Change-Id: Ic9f88a1905eca66f67b94ce75a04b9b26b6ca7ca
2021-11-16 19:49:44 +00:00
Eric Biggers
078a507c43 Merge changes Icdff584e,I71fd98e6,If1e9e3ad,I05bc4dc9 am: 017e95fa6a
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1887522

Change-Id: If1d52fea241fa0732f4e1964f616a6e0c57b7303
2021-11-11 21:38:43 +00:00
Eric Biggers
017e95fa6a Merge changes Icdff584e,I71fd98e6,If1e9e3ad,I05bc4dc9
* changes:
  Remove vdc.rc
  Remove IgnoreEarlyBootEnded()
  Remove CRYPT_FOOTER_OFFSET
  Remove scrypt-related code
2021-11-11 21:21:32 +00:00
Eric Biggers
d89e239c56 Remove vdc.rc
Now that FDE is no longer supported, the "defaultcrypto" and "encrypt"
events are never triggered.  Therefore, the actions in vdc.rc aren't
needed anymore.

Bug: 191796797
Change-Id: Icdff584ec664b3e038f0accdc826437d261fed51
2021-11-10 14:03:48 -08:00
Eric Biggers
72ca0cf3f9 Remove IgnoreEarlyBootEnded()
Now that FDE is no longer supported, this is no longer needed.

Bug: 191796797
Change-Id: I71fd98e66fd0998b78b8d56507cc62e1a112263a
2021-11-10 14:03:48 -08:00
Eric Biggers
230d664e08 Remove CRYPT_FOOTER_OFFSET
This is no longer used.

Bug: 191796797
Change-Id: If1e9e3ad255714c37a8c1f292823f181eab7a1ce
2021-11-10 14:03:48 -08:00
Eric Biggers
7c111e4529 Remove scrypt-related code
This is no longer used.

Bug: 191796797
Change-Id: I05bc4dc9c25c050ace49606981c4f4db3d76f401
2021-11-10 13:27:53 -08:00
Eric Biggers
650828aabf Merge "Remove most of FDE support" am: a70c666688
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1875760

Change-Id: I1d28b3ea12b7b132d2680decbd35ab80920e3634
2021-11-10 19:10:41 +00:00
Eric Biggers
a70c666688 Merge "Remove most of FDE support" 2021-11-10 19:05:05 +00:00
Xin Li
06517b71b6 Merge sc-qpr1-dev-plus-aosp-without-vendor@7810918
Bug: 205056467
Merged-In: I026ad515c20a042f87d3ce580c28745e68c0f939
Change-Id: I8dc9a2c27a483de8845db7c6e1f60ab37f29d27e
2021-11-10 08:06:30 +00:00
Eric Biggers
0803ba0985 Remove most of FDE support
Since Android 10, new devices have been required to use FBE instead of
FDE.  Therefore, the FDE code is no longer needed.

Remove most of cryptfs.cpp.  A few parts of it need to be kept in order
to support the dm-crypt method of adoptable storage encryption.

Keep the FDE-specific binder methods stubbed out for now until their
callers can be removed.

Bug: 191796797
Change-Id: I90b1e4cacd2f3e5cce77a82a0af744fcc7da9400
2021-11-09 16:09:33 -08:00
David Anderson
57ca48b788 Merge changes Ia095340c,I464edc6e am: 3d1a532efc
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1883358

Change-Id: If66258821cd75f3ac755f89eb6aa0b69321fdf48
2021-11-08 23:09:38 +00:00
David Anderson
3d1a532efc Merge changes Ia095340c,I464edc6e
* changes:
  Route error logs to the kernel during early boot.
  Improve vold logging.
2021-11-08 22:46:35 +00:00
David Anderson
52de78e97b Route error logs to the kernel during early boot.
This is needed to debug vold mounting errors before adb is up. It also
helps diagnose failures on devices that store dmesg persistently.

Tested by adding an error log with serial attached.

Bug: 205314634
Test: manual test
Change-Id: Ia095340c562e3f1f94bc44c5d13ad466a7a35345
2021-11-08 13:22:54 -08:00
David Anderson
e179157dc5 Improve vold logging.
This patch adds more error logging to mountFstab. In a few cases, the
were error paths with no existing error logs. In other cases, the log
messages are there to help understand error flow in logs (for example
when a function with lots of error paths returns false).

Bug: 205314634
Test: treehugger builds
Change-Id: I464edc6e74ea0d7419ee9d9b75fd238752c13f4f
2021-11-08 13:22:53 -08:00
Treehugger Robot
7a65ee339b Merge "Enable dynamic read logs buffer sizing for incfs" am: 2a89e7c577
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1874527

Change-Id: I7587da946ceae55021235814444eef04f315516e
2021-10-28 23:17:45 +00:00
Treehugger Robot
2a89e7c577 Merge "Enable dynamic read logs buffer sizing for incfs" 2021-10-28 23:01:58 +00:00
Yurii Zubrytskyi
1d7acfddf7 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
2021-10-28 14:41:48 -07:00
Tianjie Xu
821e6c7db4 Merge "Delete the checkin directory with the wrong context" am: 2c48d37a29
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1866819

Change-Id: Ia1fd614583176ced6135b8dfb4be8760273d9eec
2021-10-25 21:13:23 +00:00
Tianjie Xu
2c48d37a29 Merge "Delete the checkin directory with the wrong context" 2021-10-25 20:57:29 +00:00
Tianjie
b2ee9e0771 Delete the checkin directory with the wrong context
http://aosp/1845900 creates the directory with the wrong permission
and context. And when we attempt to fix it in http://aosp/1860276, the
device would fail to boot if the device is already on the bad build.

As a temporarily fix, already delete that checkin directory in vold. And
we can revert the deletion when the droidfood daily polulation gets out
of the bad state.

Bug: 203742483
Test: Update from TP1A.211016.001 and make sure the boot doesn't fail
Change-Id: Iec74528c1fe0e5876acc601e5cd008f99852d269
2021-10-22 18:28:29 +00:00
Tianjie Xu
5901afa842 Merge "Correct the permission of checkin dir" am: 9696432564
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1860276

Change-Id: I114df75669af98d88e71189f60fce2cb1ec3db00
2021-10-19 21:55:26 +00:00