Commit graph

5760 commits

Author SHA1 Message Date
Paul Lawrence
e65035d17d Merge "Add persist.sys.fuse.bpf.override" am: c4bc218452 am: 146112e660
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2355603

Change-Id: Iaed2486a7a3047802974ee5940ef64546dd22d1e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-16 17:56:12 +00:00
Paul Lawrence
146112e660 Merge "Add persist.sys.fuse.bpf.override" am: c4bc218452
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2355603

Change-Id: Ia2f439eb4761fa6f765e05e430b444b9dbd7f2b5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-16 17:23:15 +00:00
Paul Lawrence
c4bc218452 Merge "Add persist.sys.fuse.bpf.override" 2022-12-16 16:49:54 +00:00
David Anderson
72b29de7eb Merge "Skip new userdata pre-create logic on kernels < 5.15." am: 1bb7a963c0 am: 3561a10403
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2352584

Change-Id: Ic3e026446032c2223a16ace645493f34db2e4bb6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-15 18:41:32 +00:00
David Anderson
3561a10403 Merge "Skip new userdata pre-create logic on kernels < 5.15." am: 1bb7a963c0
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2352584

Change-Id: I8679e8f50a3797397afc806efc67ee8542733cc0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-15 18:08:05 +00:00
David Anderson
1bb7a963c0 Merge "Skip new userdata pre-create logic on kernels < 5.15." 2022-12-15 17:26:59 +00:00
David Anderson
223c1b2499 Skip new userdata pre-create logic on kernels < 5.15.
Bug: 259328366
Test: table is not populated on 5.4
Change-Id: Idbf6aa11f25d5b9ba6b02917ae358f750da5fa48
2022-12-14 21:57:58 -08:00
Paul Lawrence
a688c4f1b2 Add persist.sys.fuse.bpf.override
Allows for easy override of fuse-bpf for testing without a rebuild

Test: Set this property with ro.fuse.bpf.enabled both true and false
      Make sure ro.fuse.bpf.is_running is expected result
Bug: 219958836
Change-Id: I589511ea5cda76db1d55bdc2124fb546907d8acd
2022-12-14 15:00:20 -08:00
Treehugger Robot
dc6ef047e2 Merge "Add ro.fuse.bpf.is_running" am: 1edb6550ab am: f0dec736c2
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2346803

Change-Id: I651eeeb640aa16ec35ad117cc9ac941c46c09acd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-13 16:26:07 +00:00
Treehugger Robot
f0dec736c2 Merge "Add ro.fuse.bpf.is_running" am: 1edb6550ab
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2346803

Change-Id: I384c0f605a2cf69430d4d6e1a9cde1358e715ae6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-13 15:56:11 +00:00
Treehugger Robot
1edb6550ab Merge "Add ro.fuse.bpf.is_running" 2022-12-13 15:22:48 +00:00
Paul Lawrence
8c250754a9 Add ro.fuse.bpf.is_running
s_running flag signals to tests whether fuse-bpf is running

Test: Builds, runs, ro.fuse.bpf.is_running is correct, fuse-bpf works
Bug: 202785178
Change-Id: I2b967567092da2fab90e44c44ff2e51b372b85ed
2022-12-12 17:08:42 -08:00
David Anderson
870ec56622 Merge "Populate the dm table of the early userdata device." am: 3937b479bd am: d334e77348
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2336136

Change-Id: I65c3cb33e0988f4212cb85600fc4cdda4d946382
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-12 19:25:04 +00:00
David Anderson
d334e77348 Merge "Populate the dm table of the early userdata device." am: 3937b479bd
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2336136

Change-Id: Iabe97790ca7753d4de9c8c612e900b4e5b64238f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-12 18:54:35 +00:00
David Anderson
3937b479bd Merge "Populate the dm table of the early userdata device." 2022-12-12 18:38:05 +00:00
Martijn Coenen
ba9d81bfc8 Merge "Support bind mounting volumes into other volume's mountpoint." am: 35eb1ae88a am: 1968bd5a1b
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2189643

Change-Id: I9712ae9dd4965ba0038b0b255294728462a2985a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-09 08:24:46 +00:00
Martijn Coenen
1968bd5a1b Merge "Support bind mounting volumes into other volume's mountpoint." am: 35eb1ae88a
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2189643

Change-Id: I3e0528ff7a114971a8b6da9cc939c3de0de9fd4f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-09 08:03:52 +00:00
Martijn Coenen
35eb1ae88a Merge "Support bind mounting volumes into other volume's mountpoint." 2022-12-09 07:42:00 +00:00
David Anderson
7b769bc5b1 Populate the dm table of the early userdata device.
DM_DEV_CREATE no longer creates sysfs nodes as of Linux kernel 5.15. It
is now necessary to DM_TABLE_LOAD as well.

Bug: 259328366
Test: userdata mounts
Change-Id: I0f88afdf95a97d44eb365e4302bbfdc7c28c0bcb
2022-12-08 16:23:45 -08:00
Martijn Coenen
73e3010a25 Support bind mounting volumes into other volume's mountpoint.
With the way the FUSE mount point are currently setup for emulated
volumes, there can be multiple paths that serve the same files on the
lower filesystem; eg

* /mnt/user/0/emulated/0/Android
* /mnt/user/10/emulated/0/Android

both refer to the same file on the lower filesystem:
* /data/media/0/Android

this is normally not a problem, because cross-user file access is not
allowed, and so the FUSE daemon won't serve files for other users.

With clone profiles this is no longer true however, as their volumes
are accessible by each other.

So, it can happen that an app running in clone profile 10 accesses
"/mnt/user/10/emulated/0/Android", which would be served by the FUSE
daemon for the user 10 filesystem.

At the same time, an app running in the owner profile 0 accesses
"mnt/user/0/emulated/0/Android", which would be served by the FUSE
daemon for the user 0 filesystem.

This can cause page cache inconsistencies, because multiple FUSE daemons
can be running on top of the same entries in the lower filesystem.

To prevent this, use bind mounts to make sure that cross-profile
accesses actually end up in the FUSE daemon to which the volume
belongs: "/mnt/user/10/emulated/0" is bind-mounted to
"/mnt/user/0/emulated/0", and vice-versa.

Bug: 228271997
Test: manual
Change-Id: Iefcbc813670628b329a1a5d408b6126b84991e09
2022-12-07 09:01:27 +00:00
Treehugger Robot
910acad3c3 Merge "Ignore DE retrieveKey failure for non-user-0" am: 1cb65f9de5 am: c63d77bc61
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2242642

Change-Id: I638cd7a1e85a670352054ec44308e4e3bba25ee6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-29 03:17:33 +00:00
Treehugger Robot
c63d77bc61 Merge "Ignore DE retrieveKey failure for non-user-0" am: 1cb65f9de5
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2242642

Change-Id: Iecab2ad6f570e4083c1ad8dc8b432c56125befa4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-29 02:17:11 +00:00
Treehugger Robot
1cb65f9de5 Merge "Ignore DE retrieveKey failure for non-user-0" 2022-11-29 01:19:25 +00:00
liulvping
69b048507f Ignore DE retrieveKey failure for non-user-0
retrieveKey can fail in load_all_de_keys if a user
is partially removed, i.e. cases where
fscrypt_destroy_user_key() got interrupted. So just
ignore the failure, else could reboot into recovery.

Test: pm create-user foo
      pm remove-user 10
      adb reboot && check device not enter recovery

Signed-off-by: liulvping <liulvping@xiaomi.com>
Change-Id: Iba9d53a0833524d00e65d0427ab03002c5d8d509
2022-11-25 00:59:14 +00:00
Paul Crowley
54654ba918 Merge "Fix unhandled exception when FUSE disabled" am: 20b1532b85 am: 3589e76deb
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2282933

Change-Id: I55051756a3d2821b51146951f7b06ba2931afd3f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-09 14:38:07 +00:00
Paul Crowley
3589e76deb Merge "Fix unhandled exception when FUSE disabled" am: 20b1532b85
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2282933

Change-Id: Iaceb4670a0032ac31bfe330e3f879b06fa351050
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-09 14:09:34 +00:00
Paul Crowley
20b1532b85 Merge "Fix unhandled exception when FUSE disabled" 2022-11-09 13:42:39 +00:00
Oleg Lyovin
667de184ed Fix unhandled exception when FUSE disabled
When running on kernel without FUSE, fs::directory_iterator
throws exception since /sys/fs/fuse/connections is missing.

This patch uses non-throwing fs::directory_iterator
and adds explicit error check.

Test: vold doesn't fail with FUSE disabled
Signed-off-by: Oleg Lyovin <ovlevin@sberdevices.ru>
Change-Id: I51b68363edf75033fcec3ce5623f419d5a68c991
2022-11-08 18:49:18 +03:00
Eric Biggers
72f359dd27 Merge "Stop using the "stretching" file" am: b0a170136c am: 20695553e1
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2252876

Change-Id: I99d3b6ab789c897ae888e83b5e5130f877ab3768
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-13 20:55:57 +00:00
Eric Biggers
20695553e1 Merge "Stop using the "stretching" file" am: b0a170136c
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2252876

Change-Id: Idc5c0d3e11e9091e4c83d34188d961d5531718e3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-13 20:17:14 +00:00
Eric Biggers
b0a170136c Merge "Stop using the "stretching" file" 2022-10-13 19:46:32 +00:00
Eric Biggers
f187f05110 Stop using the "stretching" file
As a small optimization and code simplification, stop reading and
writing the "stretching" file alongside each stored key.  vold never
does key stretching anymore.

There was one special case in the code where if the stretching file
existed and contained "nopassword", then the secret was ignored.
However, this didn't seem to be of any use, especially since it didn't
cause Keystore to be used, so it did *not* allow a key stored with no
secret to be read if a secret was unexpectedly provided.

Bug: 232452368
Bug: 251131631
Bug: 251147505
Change-Id: I5a7cbba7492526e51c451f222b9413d9fae6bce5
2022-10-13 04:11:27 +00:00
Eric Biggers
1118f5fc4e Merge "Don't use a secdiscardable file for keys encrypted by SP" am: 7cc31eb7b0 am: da999d55e5
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2242561

Change-Id: Id33248ab1c5f46ae350dd73a826bb4797f0584c4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-10 17:23:42 +00:00
Eric Biggers
da999d55e5 Merge "Don't use a secdiscardable file for keys encrypted by SP" am: 7cc31eb7b0
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2242561

Change-Id: Id6c2f7797065a1bdec29996ef8433b8721bacfa7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-10 16:55:00 +00:00
Eric Biggers
7cc31eb7b0 Merge "Don't use a secdiscardable file for keys encrypted by SP" 2022-10-10 16:26:26 +00:00
Eric Biggers
08f4bdfe98 Don't use a secdiscardable file for keys encrypted by SP
Storage keys that are encrypted by the user's synthetic password don't
need to be securely deletable by vold, since secure deletion is already
implemented at a higher level: the synthetic password protectors managed
by LockSettingsService.  Therefore, remove the use of the secdiscardable
file by vold in this case to improve performance.

Bug: 232452368
Bug: 251131631
Bug: 251147505
Change-Id: I847d6cd3b289dbeb1ca2760d6e261a78c179cad0
2022-10-07 16:26:29 +00:00
Eric Biggers
17cf387bca Merge "cryptfs: Update the size of dm-crypt device according to sector size" am: 03ad91c3c2 am: c33624f8b2 am: cfa19bbb92 am: 56c8e62553
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2230826

Change-Id: I564af10985e9f957d981f9985f1c0bfe18a107d6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-29 18:38:39 +00:00
Eric Biggers
56c8e62553 Merge "cryptfs: Update the size of dm-crypt device according to sector size" am: 03ad91c3c2 am: c33624f8b2 am: cfa19bbb92
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2230826

Change-Id: I2e226ca8f977ca2f0297754808ebd78d2b0a1b8b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-29 17:56:58 +00:00
Eric Biggers
cfa19bbb92 Merge "cryptfs: Update the size of dm-crypt device according to sector size" am: 03ad91c3c2 am: c33624f8b2
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2230826

Change-Id: I29988364b1584f326b39fdabeb4b51d167758aa5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-29 17:27:23 +00:00
Eric Biggers
c33624f8b2 Merge "cryptfs: Update the size of dm-crypt device according to sector size" am: 03ad91c3c2
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2230826

Change-Id: I73de338c1bd35c3257a473183bf0e0cfebe179b5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-29 16:57:43 +00:00
Eric Biggers
03ad91c3c2 Merge "cryptfs: Update the size of dm-crypt device according to sector size" 2022-09-29 16:26:44 +00:00
Hongyu Jin
8eeb028338 cryptfs: Update the size of dm-crypt device according to sector size
The legacy method for metadata encryption on adoptable storage failed
when the size of the block device isn't a multiple of the crypto sector size.

Update the size of dm-crypt device according to sector size
before construct dm_target.

Bug: 248582018
Change-Id: I5c78889bdfedca7f7b0704500fc313d7a48d5a3b
Signed-off-by: Hongyu Jin <hongyu.jin@unisoc.com>
2022-09-28 17:44:44 +08:00
Automerger Merge Worker
af757e65cb [automerger skipped] Merge changes from topic "am-96e5992b2dd4470eae48f4ad98b53c99" into stage-aosp-master am: 9ac39c470e -s ours am: b4a0098b68 -s ours am: 86b47687be -s ours
am skip reason: Merged-In I648a1af9e16787dfcfeefa2b2f2e4a72cac2c6a6 with SHA-1 2d30b890d2 is already in history

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2186984

Change-Id: I0f16d59d0fd19f3e1c31f1e1b34f7745a1854ded
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-17 01:09:55 +00:00
Xin Li
0a83c797d7 [automerger skipped] Merge "DO NOT MERGE - Merge Android 13" am: 3f658163ee -s ours am: 54f0f20543 -s ours am: 597549b42f -s ours am: 2a7108b74d -s ours
am skip reason: Merged-In I648a1af9e16787dfcfeefa2b2f2e4a72cac2c6a6 with SHA-1 2d30b890d2 is already in history

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2186984

Change-Id: Ic61f28f1c336a049d02664b12a4d6c95c98323b0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-17 01:09:32 +00:00
Automerger Merge Worker
86b47687be [automerger skipped] Merge changes from topic "am-96e5992b2dd4470eae48f4ad98b53c99" into stage-aosp-master am: 9ac39c470e -s ours am: b4a0098b68 -s ours
am skip reason: Merged-In I648a1af9e16787dfcfeefa2b2f2e4a72cac2c6a6 with SHA-1 2d30b890d2 is already in history

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2186984

Change-Id: I66e62f75632b9997f411989952dea65f6cbb6c9f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-17 00:55:28 +00:00
Xin Li
2a7108b74d [automerger skipped] Merge "DO NOT MERGE - Merge Android 13" am: 3f658163ee -s ours am: 54f0f20543 -s ours am: 597549b42f -s ours
am skip reason: Merged-In I648a1af9e16787dfcfeefa2b2f2e4a72cac2c6a6 with SHA-1 2d30b890d2 is already in history

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2186984

Change-Id: Ia960d269e55ca3a616f92e35d78eb775b0f42089
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-17 00:55:03 +00:00
Xin Li
09f73b0583 [automerger skipped] Merge "DO NOT MERGE - Merge Android 13" am: 3f658163ee -s ours am: e23109dbf7 -s ours am: dadfcc26b9 -s ours am: 3fae96b70b -s ours
am skip reason: Merged-In I648a1af9e16787dfcfeefa2b2f2e4a72cac2c6a6 with SHA-1 2d30b890d2 is already in history

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2186984

Change-Id: I8081ab864aaf5d222f02a0ac3cf8557b058a959c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-17 00:50:25 +00:00
Xin Li
0bf71b45f0 [automerger skipped] DO NOT MERGE - Merge Android 13 am: 302f60e5f3 -s ours am: 24dc4748aa -s ours am: 1919d625b8 -s ours am: 169df91cca -s ours
am skip reason: Merged-In I648a1af9e16787dfcfeefa2b2f2e4a72cac2c6a6 with SHA-1 2d30b890d2 is already in history

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2186984

Change-Id: I22c2be9483000fbf4b7c44190828b7ee96bc7ef4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-17 00:50:02 +00:00
Elliott Hughes
ee8e50a9c1 Merge "Switch to C23's memset_explicit()." am: dd7cfa9e15 am: 6e9353e630 am: f90e6ab299 am: e88b2d376b
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2184090

Change-Id: I355ae1a0520518741a48a1a6bc94d66cf703810c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-17 00:34:59 +00:00
Trevor Radcliffe
7b95754f91 Merge "Point directly to generated c sysprop_library" am: bdba7cdaa3 am: 891e2f0730 am: 63f5844cc9 am: 18556ea24e
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2119958

Change-Id: I5fca3a2c831dcddebd93b2cb7fbc09036c39720f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-17 00:34:51 +00:00