Commit graph

5987 commits

Author SHA1 Message Date
Eric Biggers
29b381b796 Merge "Move encrypted directories into place already-encrypted" am: ec6e52aadc am: 01ca68c4f8 am: 8e38d39179
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2620092

Change-Id: Ice304428e084b2d4ce2ef2e1904b0fb2b57a5261
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-14 00:08:32 +00:00
Eric Biggers
8e38d39179 Merge "Move encrypted directories into place already-encrypted" am: ec6e52aadc am: 01ca68c4f8
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2620092

Change-Id: Ib6627057ba9d1a11fc3ca2f7dbdc53254a4bf35f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-13 23:21:11 +00:00
Eric Biggers
01ca68c4f8 Merge "Move encrypted directories into place already-encrypted" am: ec6e52aadc
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2620092

Change-Id: I0937a39d1b09ef4201b9c194543890685784fc77
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-13 22:40:35 +00:00
Eric Biggers
ec6e52aadc Merge "Move encrypted directories into place already-encrypted" 2023-06-13 22:11:39 +00:00
Eric Biggers
c6f004a9c4 Move encrypted directories into place already-encrypted
Even after having changed the SELinux policy to remove system_server's
permission to create directories like /data/system_ce/10, there's still
a very small loophole where system_server can create a subdirectory
after vold creates the directory but before vold assigns an encryption
policy to it.  This isn't known to have actually happened (b/285239971
was a candidate, but it seems to have actually been caused by SELinux
being in permissive mode), but it's theoretically possible.

Close this loophole by making vold create encrypted directories under
temporary names and move them into place once they are fully prepared.

Bug: 156305599
Bug: 285239971
Test: Cuttlefish boots, and can be rebooted.
Change-Id: I53407c938bab02ab4b7e5bab8402f36eb47fb203
2023-06-08 22:08:09 +00:00
Treehugger Robot
38f9593a28 Merge "vold: move some libs from shared to static" am: 39f11368a5 am: f4ae30da97 am: f042721b4d
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2598907

Change-Id: Idcfda60f4e545c6b274e12ced27a628a0307f6f3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-23 18:16:34 +00:00
Treehugger Robot
f042721b4d Merge "vold: move some libs from shared to static" am: 39f11368a5 am: f4ae30da97
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2598907

Change-Id: I926f4b96d2a4b6d57f606afec1384c779d82990a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-23 17:33:57 +00:00
Treehugger Robot
f4ae30da97 Merge "vold: move some libs from shared to static" am: 39f11368a5
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2598907

Change-Id: I237a3145216534a9c2e601e5c5606bbc87ea68eb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-23 17:11:46 +00:00
Treehugger Robot
39f11368a5 Merge "vold: move some libs from shared to static" 2023-05-23 16:33:31 +00:00
Devin Moore
965d67ce6f vold: move some libs from shared to static
These libraries are only used by vold on a device and gain no
benifit from being included as shared libraries.

Moving them to static saves disk space, memory, and cpu cycles from the
dynamic linker.

Checking on cuttlefish accross 3 reboots:
This saves 613827 bytes of storage from the installed-files, 44KB of
private dirty memory, 172KB of PSS when only looking at the
libraries, and 155KB of PSS when looking at libraries and heap/stack
with shomap.

go/shared-to-static for more info on how this was determined.

Test: m
Bug: 280829178

Change-Id: I29af66dd66f4087ff1820ca661dc6dc2ace841fc
2023-05-23 00:37:02 +00:00
Pawan Wagh
ef0d064fa2 Merge "Disable leak detection in vold fuzzer" am: a3e128a868 am: b7792484f1 am: c25a1e04f3
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2577820

Change-Id: I5c289e5f81ca9addac64650ca5384c6502da251e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-09 00:16:39 +00:00
Pawan Wagh
c25a1e04f3 Merge "Disable leak detection in vold fuzzer" am: a3e128a868 am: b7792484f1
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2577820

Change-Id: Ic5d49ddcf0345af10042ea606db625f905b6e001
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-08 23:29:17 +00:00
Pawan Wagh
b7792484f1 Merge "Disable leak detection in vold fuzzer" am: a3e128a868
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2577820

Change-Id: I6d93f475f686d817fc847cced4e8164a921bf32c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-08 23:06:22 +00:00
Pawan Wagh
a3e128a868 Merge "Disable leak detection in vold fuzzer" 2023-05-08 22:53:03 +00:00
Pawan Wagh
e7b16911cb Disable leak detection in vold fuzzer
Bug: 278100447
Bug: 277650211
Test: m vold_native_service_fuzzer
Change-Id: I90ecbdadde5bfcdc967d8b5b750f0e551f30acb0
2023-05-05 23:57:13 +00:00
Treehugger Robot
ee28350374 Merge "[vold] Add mount lazy if forcemount fail." am: 823898eca3 am: 3741a1635b am: d6291a5c31
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1764385

Change-Id: I89d25fe25eb4c8657fb51277407694e132a037fe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-25 12:13:21 +00:00
Treehugger Robot
d6291a5c31 Merge "[vold] Add mount lazy if forcemount fail." am: 823898eca3 am: 3741a1635b
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1764385

Change-Id: I771a33c85e35ce003e676bd60784b2a2ca0f2e57
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-25 11:47:49 +00:00
Treehugger Robot
3741a1635b Merge "[vold] Add mount lazy if forcemount fail." am: 823898eca3
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1764385

Change-Id: If915976e128592cd93e0b7fdde4f9768f6155d1a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-25 11:09:13 +00:00
Treehugger Robot
823898eca3 Merge "[vold] Add mount lazy if forcemount fail." 2023-04-25 10:32:16 +00:00
Paul Lawrence
9adf86a881 Log reason for fuse-bpf being enabled/disabled
Also don't try to set ro.fuse.bpf.is_running if it's already set.

Bug: 278263648
Ignore-AOSP-First: Feature is in internal
Test: Examine logs with various properties set
Change-Id: I9623a02c7065fa0d0c71c618d448bda0cd2a900e
2023-04-14 21:59:05 +00:00
Paul Lawrence
ee0a2bf52e Merge "Use kernel sys/fs/fuse/features/fuse_bpf flag to enable fuse_bpf" into udc-dev 2023-04-12 14:31:27 +00:00
Steven Moreland
15e9b2f3ad Merge "Explicit init .rc user." am: 6c8b6e1651 am: 0b6dd2c641 am: e9eee2b50e
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2530203

Change-Id: Ib45eadd4459b4e07e28737658370e03c314f69fb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-12 03:16:08 +00:00
Steven Moreland
e9eee2b50e Merge "Explicit init .rc user." am: 6c8b6e1651 am: 0b6dd2c641
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2530203

Change-Id: I323939dd2d50c62797603e2dc5c1848c61231bd8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-12 02:44:20 +00:00
Steven Moreland
0b6dd2c641 Merge "Explicit init .rc user." am: 6c8b6e1651
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2530203

Change-Id: I6a4938c8ea0918f8421d92e6d82d6b9d3c5dfeed
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-12 02:12:34 +00:00
Steven Moreland
6c8b6e1651 Merge "Explicit init .rc user." 2023-04-11 21:33:30 +00:00
Steven Moreland
0eff1d2890 Explicit init .rc user.
Set the user explicitly.

Bug: 276813155
Test: boot
Change-Id: I54c14c47a3435d72e00280cf663f23ffbb9659ee
2023-04-10 20:54:26 +00:00
Paul Lawrence
7278162512 Use kernel sys/fs/fuse/features/fuse_bpf flag to enable fuse_bpf
Bug: 262887267
Test: ro.fuse.bpf.is_running is true
Ignore-AOSP-First: This breaks multiple tests because the rest of
fuse_bpf is not in aosp
Change-Id: I3c41c7a0992803a100a1a7eeecd2c5f57e6085fd
2023-04-03 16:55:45 +00:00
Daeho Jeong
bfb937b068 Merge "vold: fix write kbytes handling" am: 13a57d2a26 am: 486c3507fb am: d4680bb584
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2507268

Change-Id: I97a52712004285b30340f428f280abe43a0c7a7d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-28 21:29:55 +00:00
Daeho Jeong
d4680bb584 Merge "vold: fix write kbytes handling" am: 13a57d2a26 am: 486c3507fb
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2507268

Change-Id: I697ba818c7399584b81c831eb14a8a4d55be7cee
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-28 21:11:18 +00:00
Daeho Jeong
486c3507fb Merge "vold: fix write kbytes handling" am: 13a57d2a26
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2507268

Change-Id: I0ea8d3eb6fe49612077a23b30a5fce5a7627a871
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-28 20:40:45 +00:00
Daeho Jeong
13a57d2a26 Merge "vold: fix write kbytes handling" 2023-03-28 20:15:53 +00:00
Daeho Jeong
dd08c52eb8 vold: fix write kbytes handling
Since Android platform codespace doesn't support exception handling, we
use strtoll() instead of stoll for direct error handling.

Bug: 274369737
Test: check smart idle maintenace service log
Change-Id: I57c709b1e329228790e0a883edb64dc023135a24
2023-03-27 18:19:18 -07:00
Nathan Huckleberry
99b2289954 [automerger skipped] Clean up potential busy files after key eviction. am: 759ac5f87c -s ours am: e828c966e3 -s ours
am skip reason: Merged-In I9e39e5bb0f5190284552bcd252b6213a22a51e91 with SHA-1 a21962b207 is already in history

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

Change-Id: Ic60f93e88d4ab638bd88bb595059d9d419307fb5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-17 01:03:12 +00:00
Nathan Huckleberry
e828c966e3 [automerger skipped] Clean up potential busy files after key eviction. am: 759ac5f87c -s ours
am skip reason: Merged-In I9e39e5bb0f5190284552bcd252b6213a22a51e91 with SHA-1 a21962b207 is already in history

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

Change-Id: I16aa0e7cfe276c918affdbddc58e593e2f1c2eeb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-17 00:26:48 +00:00
Pawan Wagh
f15652879e Merge "Set sehandle in voldFuzzer" am: c1572fe8cf am: b43fe97e5a am: 0d069ca15a
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2492755

Change-Id: I489e84ee7c4c2212eb5a810c9d3f18ad37e734af
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-16 09:25:41 +00:00
Pawan Wagh
0d069ca15a Merge "Set sehandle in voldFuzzer" am: c1572fe8cf am: b43fe97e5a
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2492755

Change-Id: Ic386ce0bc09e0b0cafdce9c612a278aff6fccb36
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-16 08:47:39 +00:00
Pawan Wagh
b43fe97e5a Merge "Set sehandle in voldFuzzer" am: c1572fe8cf
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2492755

Change-Id: I60003de6b4df333663c168483acc5d967c16dd84
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-16 08:10:28 +00:00
Pawan Wagh
c1572fe8cf Merge "Set sehandle in voldFuzzer" 2023-03-16 07:28:40 +00:00
Pawan Wagh
25effc38ff Set sehandle in voldFuzzer
Bug: 271649747
Test: m vold_native_service_fuzzer && adb sync && adb shell data/fuzz/x86_64/vold_native_service_fuzzer/vold_native_service_fuzzer
Change-Id: I55a17ffd631b0b85e2fc049bffe9a91623699e64
2023-03-15 20:54:42 +00:00
Eric Biggers
10f3d7ec32 Merge "Avoid error message when destroying key w/o secdiscardable file" am: dc262c27f0 am: 60c71b9950 am: 2ef1832ac4
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2470460

Change-Id: I9a0edebc0100cd56077e95ff5adb3f40d7b5129f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-04 07:49:59 +00:00
Eric Biggers
2ef1832ac4 Merge "Avoid error message when destroying key w/o secdiscardable file" am: dc262c27f0 am: 60c71b9950
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2470460

Change-Id: I3c1ccbf5a48de8281db1244471f40831e32decbe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-04 07:16:23 +00:00
Eric Biggers
60c71b9950 Merge "Avoid error message when destroying key w/o secdiscardable file" am: dc262c27f0
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2470460

Change-Id: I0259a28cc469a98149512f258751771f09112fda
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-04 06:30:21 +00:00
Eric Biggers
dc262c27f0 Merge "Avoid error message when destroying key w/o secdiscardable file" 2023-03-03 22:14:58 +00:00
Eric Biggers
73e2936fc2 Avoid error message when destroying key w/o secdiscardable file
Since commit 08f4bdfe98 ("Don't use a secdiscardable file for keys
encrypted by SP") (https://r.android.com/2242561), some keys don't use a
secdiscardable file.  Currently if such a key is destroyed, an ERROR
message like the following is logged:

    E secdiscard: Secure discard open failed for: /data/misc/vold/user_keys/ce/14/current/secdiscardable

This case is expected, so it should not be an ERROR.  Fix this by only
passing the secdiscardable file to the secdiscard program if it exists.

Bug: 232452368
Change-Id: I490289dfdaf0db6c3f4fb507509095e0033e2f69
2023-03-03 19:51:36 +00:00
Eric Biggers
13c2e12a5a Merge "Check for SELinux labelling errors" am: 826eef6b33 am: 0c7abb02e5 am: 44d3181bc5
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2465051

Change-Id: Ie71dab9cd4818e1ab7d37c5442b451776451b328
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-02 20:27:49 +00:00
Eric Biggers
44d3181bc5 Merge "Check for SELinux labelling errors" am: 826eef6b33 am: 0c7abb02e5
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2465051

Change-Id: I25c3b804e4e4814a357d8428231c42a33a5f01d8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-02 19:49:30 +00:00
Eric Biggers
0c7abb02e5 Merge "Check for SELinux labelling errors" am: 826eef6b33
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2465051

Change-Id: I55ae26d92455278fb9e687571392083c5859e4d9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-02 19:14:42 +00:00
Eric Biggers
826eef6b33 Merge "Check for SELinux labelling errors" 2023-03-02 18:35:16 +00:00
Eric Biggers
c7c4f5a902 Check for SELinux labelling errors
It's essential that files created by vold get the correct SELinux
labels, so make sure to check for errors when setting them.

ENOENT (no label defined) is expected on some files such as
/mnt/appfuse/*, so allow ENOENT but log a DEBUG message.

This will help debug b/269567270.  This is not a fix for b/269567270.

Bug: 269567270
Test: Created user and checked SELinux labels of user's directories
Test: atest CtsBlobStoreHostTestCases
Change-Id: Ife005bdd896952653943c57336deb33456f7c5d8
2023-03-01 22:11:29 +00:00
Austin Delgado
6ed3654033 Merge "Revert "Strictly check for SELinux labelling errors"" am: 545f0ab758 am: 9a4265cc20 am: edb3220e2b
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2461593

Change-Id: I9839fde4983f0ef66e5da75f9ad26537765b4773
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-01 00:19:37 +00:00