Commit graph

6050 commits

Author SHA1 Message Date
Alfred Piccioni
fc4934feb4 Revert "Add NTFS support in vold"
This reverts commit 564f6c649a.

Reason for revert: Un-backporting.

Note: This is not a direct revert. We should keep the minor refactoring
in PublicVolume.cpp; no point making the code worse.

Test: Revert.
Change-Id: Ic03ed25ad15a2da974921542a20cd27224347f68
2023-02-02 11:12:25 +01:00
Alfred Piccioni
125dce22c7 [automerger skipped] Merge "Add NTFS support in vold" am: c9579dc1a6 am: 8271b66244 am: da96f04df8 -s ours
am skip reason: Merged-In If4197c4c588866c611cd6ba3483707d3cb0e0cf8 with SHA-1 28858c9b3f is already in history

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

Change-Id: I6bc170c658d0b61c59238ce370d947916b54387d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-24 11:53:24 +00:00
Alfred Piccioni
da96f04df8 Merge "Add NTFS support in vold" am: c9579dc1a6 am: 8271b66244
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2398952

Change-Id: I0e28fb2ef60373e48c6d26c9c554d923d86b62bd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-24 11:07:53 +00:00
Alfred Piccioni
8271b66244 Merge "Add NTFS support in vold" am: c9579dc1a6
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2398952

Change-Id: I8aeaf78c999ad69435c0b7815c05279e61dc420a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-24 10:27:13 +00:00
Alfred Piccioni
c9579dc1a6 Merge "Add NTFS support in vold" 2023-01-24 09:44:18 +00:00
Alfred Piccioni
564f6c649a Add NTFS support in vold
This CR, when paired with a functional NTFS implementation and the
corresponding SEPolicy updates, will allow NTFS USB drives to be mounted
on Android.

Bug: 254407246

Test: Extensive testing with an ADT-4 and NTFS USB drives.

Merged-In: If4197c4c588866c611cd6ba3483707d3cb0e0cf8
Change-Id: If4197c4c588866c611cd6ba3483707d3cb0e0cf8
2023-01-23 11:10:38 +01:00
Treehugger Robot
482f121ed5 Merge "Do not delete all keys after creating a first crypt device" am: 9e3f17a57e am: 8e90f934f7 am: 70021209ae
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2390132

Change-Id: Ib7dbca93667e69e0633f2609cdc26a41124f883e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-19 02:34:24 +00:00
Treehugger Robot
70021209ae Merge "Do not delete all keys after creating a first crypt device" am: 9e3f17a57e am: 8e90f934f7
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2390132

Change-Id: I53d48d8cba3fc3ddff5b03729e35026e37e85159
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-19 01:56:47 +00:00
Treehugger Robot
8e90f934f7 Merge "Do not delete all keys after creating a first crypt device" am: 9e3f17a57e
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2390132

Change-Id: I09055f2d3cf6e76017fe3c4616f610044a7add6e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-19 00:52:32 +00:00
Treehugger Robot
9e3f17a57e Merge "Do not delete all keys after creating a first crypt device" 2023-01-19 00:03:53 +00:00
Jaegeuk Kim
fb9aadaf48 Do not delete all keys after creating a first crypt device
We should not delete keys, once the first one was created.

Bug: 197782466
Change-Id: Ia895c140aa16553b422748531b01931737a0ea94
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2023-01-18 14:56:46 -08:00
Xin Li
d3b7215ed1 [automerger skipped] Merge tm-qpr-dev-plus-aosp-without-vendor@9467136 am: 6ae8e3ae7b -s ours am: 170eba1e07 -s ours
am skip reason: Merged-In I5105da1b8da411d3a4b968d69a547de9e70e66ee with SHA-1 3b432309ef is already in history

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

Change-Id: I1bfe04ad38e772a3023d483a0a8f8d2389299182
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-12 21:09:20 +00:00
Xin Li
170eba1e07 [automerger skipped] Merge tm-qpr-dev-plus-aosp-without-vendor@9467136 am: 6ae8e3ae7b -s ours
am skip reason: Merged-In I5105da1b8da411d3a4b968d69a547de9e70e66ee with SHA-1 3b432309ef is already in history

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

Change-Id: Ib66451b47c53b9be1f93cb936ceff7ee1b3cd578
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-12 20:05:34 +00:00
Xin Li
6ae8e3ae7b Merge tm-qpr-dev-plus-aosp-without-vendor@9467136
Bug: 264720040
Merged-In: I5105da1b8da411d3a4b968d69a547de9e70e66ee
Change-Id: Iff3a12dc06fcf042f62a468220abe9680e535abf
2023-01-12 09:36:30 -08:00
Treehugger Robot
45edcc7db4 Merge "Do not reboot with commit failure when ext4 userdata is wiped" am: 45a3d47fd5 am: 843bda7ff7 am: 02eaf2e26c
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1770908

Change-Id: Ic756852537a6204533ddcb5618bdc3879822d8a5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-08 22:52:57 +00:00
Treehugger Robot
02eaf2e26c Merge "Do not reboot with commit failure when ext4 userdata is wiped" am: 45a3d47fd5 am: 843bda7ff7
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1770908

Change-Id: Ic3ff82d3829e522d5a02d45e2d884133ff1b1a5a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-08 22:16:01 +00:00
Treehugger Robot
843bda7ff7 Merge "Do not reboot with commit failure when ext4 userdata is wiped" am: 45a3d47fd5
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1770908

Change-Id: I4a41cf9e17224a2deb274b36ab763d2a656725af
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-08 21:57:40 +00:00
Treehugger Robot
45a3d47fd5 Merge "Do not reboot with commit failure when ext4 userdata is wiped" 2023-01-08 21:27:12 +00:00
Nikita Ioffe
cb8e5ec242 Merge "Revert "vold: explicitly specify capabilities"" am: d0c81a283b am: 4a5304d225 am: 3b432309ef
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2377728

Change-Id: Ifad3e81a0142bf27f8a79bd9d8eefa36d9a7f7ec
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-06 18:27:42 +00:00
Nikita Ioffe
3b432309ef Merge "Revert "vold: explicitly specify capabilities"" am: d0c81a283b am: 4a5304d225
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2377728

Change-Id: I5105da1b8da411d3a4b968d69a547de9e70e66ee
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-06 17:50:51 +00:00
Nikita Ioffe
4a5304d225 Merge "Revert "vold: explicitly specify capabilities"" am: d0c81a283b
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2377728

Change-Id: I3dada1b323d9361260353923af1da845fc04abcd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-06 17:17:25 +00:00
Nikita Ioffe
d0c81a283b Merge "Revert "vold: explicitly specify capabilities"" 2023-01-06 16:45:49 +00:00
David Saff
dca3714425 Revert "vold: explicitly specify capabilities"
This reverts commit a4c5f57f63.

Reason for revert: Appears to be a culprit at https://android-build.googleplex.com/builds/tests/view?invocationId=I73600010121524618&testResultId=TR49128446350696862

Change-Id: Ia575a77e22547f93f4de8f5409649abbdf5e5883
2023-01-05 21:10:37 +00:00
faqiang.zhu
dd20dc3128 Do not reboot with commit failure when ext4 userdata is wiped
When userdata partition is the type of ext4, checkpoint and metadata
encryption are enabled, boot up the images, if the slot currently
in use is not marked as "successful" and userdata is wiped, a reboot
will be triggered because of "Checkpoint commit failed"

In this patch, do not create checkpoint when the preceding condition
occurs, otherwise "dm-default-key" sits below "dm-bow".

Because cp_needsCheckpoint(), cp_prepareCheckpoint() and cp_commitChanges()
are always executed when the system boots up, and now there is a condition
that BOW device is not created while the slot in use is not marked as
"successful", set "isBow" to be "false" if BOW state fails to be set to
1, if "isBow" is false, then there is no need to commit the checkpoint,
and the system won't automatically reboot.

Bug: 193457319
Test: i.MX 8M Plus EVK, images flashed to board, misc and userdata
      partitions are wiped, checkpoint and metadata encryption are
      enabled for ext4 userdata partition.
Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
Change-Id: I4ad47a9504f1be0407f0fd196001a0e96919be33
2023-01-04 21:06:00 +00:00
Nikita Ioffe
91ab2d3cac Merge "vold: explicitly specify capabilities" am: 4af861b631 am: 8b23e23987 am: 7f7850a648
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2371428

Change-Id: I9bdb3cb51e8af125809429d8d82eb6a6d5714823
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-03 15:02:50 +00:00
Nikita Ioffe
7f7850a648 Merge "vold: explicitly specify capabilities" am: 4af861b631 am: 8b23e23987
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2371428

Change-Id: Idba29df1b014fda9ee463af137bc310baaaabd65
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-03 14:26:05 +00:00
Nikita Ioffe
8b23e23987 Merge "vold: explicitly specify capabilities" am: 4af861b631
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2371428

Change-Id: Iafe087f3d1dd180069621cc9539803a4dda1bdda
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-03 13:55:07 +00:00
Nikita Ioffe
4af861b631 Merge "vold: explicitly specify capabilities" 2023-01-03 13:18:36 +00:00
Nikita Ioffe
a4c5f57f63 vold: explicitly specify capabilities
If a service doesn't specify any capabilities in it's definition in the
.rc file, then it will inherit all the capabilities from the init.
Although whether a process can use capabilities is actually controlled
by selinux (so inheriting all the init capabilities is not actually a
security vulnerability), it's better for defense-in-depth and just
bookkeeping to explicitly specify the capabilities that vold needs.

The list of capabilities that vold is allowed to use was obtained via:
```
$ adb pull /sys/fs/selinux/policy /tmp/selinux.policy
$ sesearch --allow -s vold -c capability,capability2 /tmp/selinux.policy
allow vold vold:capability { chown dac_override dac_read_search fowner fsetid kill mknod net_admin sys_admin sys_chroot sys_nice sys_ptrace };
allow vold vold:capability2 block_suspend
```

In addition, since vold execs the /system/bin/sdcard, which transitions
into sdcardd domain, we also need to add capabilities that are required
by /system/bin/sdcard:

```
sesearch --allow -s sdcardd -c capability,capability2 /tmp/selinux.policy
allow sdcardd sdcardd:capability { dac_override dac_read_search setgid setuid sys_admin sys_resource };
```

vold can also transform into the following domains which don't seem to
need any capabilities: blkid, blkid_untrusted, fsck, fsck_untrusted

vold can also transform into sgdisk domain, which only needs
CAP_SYS_ADMIN:

```
sesearch --allow -s sgdisk -c capability,capability2 /tmp/selinux.policy
allow sgdisk sgdisk:capability sys_admin
```

Bug: 249796710
Test: device boots
Test: prebumit
Change-Id: Ic2a35fd62d6ed8c7b305c23607e6c24b197cf6bc
2022-12-29 18:34:33 +00:00
Treehugger Robot
8657fffa17 Merge "Use sleep_for for fsck timeout" am: 0777c5d604 am: 93c9dbe115 am: 55f4d7442e
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2311079

Change-Id: Ibf71954595bb1d90951406114113b0cb5ae46ca0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-17 02:42:18 +00:00
Treehugger Robot
55f4d7442e Merge "Use sleep_for for fsck timeout" am: 0777c5d604 am: 93c9dbe115
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2311079

Change-Id: Id9d6ce3801debeaa06d2338bd9a914b4105d7afc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-17 01:57:41 +00:00
Treehugger Robot
93c9dbe115 Merge "Use sleep_for for fsck timeout" am: 0777c5d604
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2311079

Change-Id: I007ddd743a88a629fac27f6bf8575957661de955
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-17 01:22:47 +00:00
Treehugger Robot
0777c5d604 Merge "Use sleep_for for fsck timeout" 2022-12-17 00:28:27 +00:00
Daniel Rosenberg
8cd81faa71 Use sleep_for for fsck timeout
sleep may exit early due to interupts.
This ensures the full expected time elapses before timing out.

Bug: 258348748
Test: Mount removable storage with ~30K folders,
      observe timeout in logs
Change-Id: I8092d4be43b85c9a53e8bb2658316159ab93bfc2
2022-12-16 22:30:57 +00:00
Paul Lawrence
50383c4272 Merge "Add persist.sys.fuse.bpf.override" am: c4bc218452 am: 146112e660 am: e65035d17d
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2355603

Change-Id: I03c616c1bffb2be47869f69f48957c5ac7a763a9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-16 18:39:44 +00:00
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
856548eb2d Merge "Skip new userdata pre-create logic on kernels < 5.15." am: 1bb7a963c0 am: 3561a10403 am: 72b29de7eb
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2352584

Change-Id: Id8a55df412d8d0b48ead3a8fdc382dcc902545da
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-15 19:23:25 +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
e1d62b1548 Merge "Add ro.fuse.bpf.is_running" am: 1edb6550ab am: f0dec736c2 am: dc6ef047e2
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2346803

Change-Id: If450454988b062f2b500560f98fbbe26fc2a5b13
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-13 17:05:44 +00: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
0e251fee9d Merge "Populate the dm table of the early userdata device." am: 3937b479bd am: d334e77348 am: 870ec56622
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2336136

Change-Id: I0a3702c872ddb69ae98d0b40d2fe4f1f4e66442a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-12 19:31:27 +00:00