OSDN Git Service
Ricky Wai [Thu, 29 Apr 2021 16:47:28 +0000 (17:47 +0100)]
Only kill apps with storage app data isolation enabled
Originally it kills all the apps with obb and data mounted.
Due to recent changes, all apps will have obb and data dirs mounted
in default root namespace. Hence all apps will be killed by
by KillProcessesWithMounts().
To fix this, we also check if the dir is mounted as tmpfs,
as the default namespace one is bind mounted to lowerfs,
which app data isolation is mounted as tmpfs, so we only
kill the process that have obb dir mounted as tmpfs.
Bug:
148049767
Test: Able to boot without warnings / errors
Ignore-AOSP-First: Merge it along with other CLs, will cherry-pick to
AOSP afterwards.
Change-Id: I45d9a63ed47cbc27aebb63357a43f51ad62275db
Treehugger Robot [Thu, 15 Apr 2021 04:42:14 +0000 (04:42 +0000)]
Merge "vold: add getUnlockedUsers() method to Binder interface" am:
5e5819a761 am:
ffcb495f2c am:
b22fa25e7b
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1674805
Change-Id: I46101eff7eaa690af8c3dc53442ba05d9a30bb8b
Treehugger Robot [Thu, 15 Apr 2021 03:52:14 +0000 (03:52 +0000)]
Merge "vold: add getUnlockedUsers() method to Binder interface" am:
5e5819a761 am:
ffcb495f2c
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1674805
Change-Id: I6a28604fbf87bc8e299596eaed5261f2925676dd
Treehugger Robot [Thu, 15 Apr 2021 03:06:01 +0000 (03:06 +0000)]
Merge "vold: add getUnlockedUsers() method to Binder interface" am:
5e5819a761
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1674805
Change-Id: I6b491e5939d3c878351bdfed3452e95ca8f19a89
Treehugger Robot [Thu, 15 Apr 2021 02:33:22 +0000 (02:33 +0000)]
Merge "vold: add getUnlockedUsers() method to Binder interface"
Eric Biggers [Tue, 6 Apr 2021 19:02:56 +0000 (12:02 -0700)]
vold: add getUnlockedUsers() method to Binder interface
This is needed so that system_server can remind itself about which users
have their storage unlocked, if system_server is restarted due to a
userspace reboot (soft restart).
Bug:
146206679
Test: see I482ed8017f7bbc8f7d4fd5a2c0f58629317ce4ed
Change-Id: I02f0494d827094bd41bcfe5f63c24e204b728595
(cherry picked from commit
1799debfd6561ca7348880bb59ad8c059f4891b0)
Eric Biggers [Tue, 13 Apr 2021 17:52:02 +0000 (17:52 +0000)]
Merge "vold: add getUnlockedUsers() method to Binder interface" into sc-dev
Eric Biggers [Tue, 6 Apr 2021 19:02:56 +0000 (12:02 -0700)]
vold: add getUnlockedUsers() method to Binder interface
This is needed so that system_server can remind itself about which users
have their storage unlocked, if system_server is restarted due to a
userspace reboot (soft restart).
Bug:
146206679
Test: see I482ed8017f7bbc8f7d4fd5a2c0f58629317ce4ed
Change-Id: I02f0494d827094bd41bcfe5f63c24e204b728595
Alex Buynytskyy [Thu, 1 Apr 2021 20:43:14 +0000 (13:43 -0700)]
Adding an option to shorten the read timeout.
E.g. during installation to protect the system.
Ignore-AOSP-First: this depends on changes to framework and/or incfs and does not make sense without them. We'll merge it at a single large scale merge later.
Bug:
160635296
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest
Change-Id: I5851e1e9dbc8e8c2b331c407002cf7133bf6e35a
Satya Tangirala [Thu, 8 Apr 2021 02:21:37 +0000 (02:21 +0000)]
Merge changes from topic "vold-use-keystore2" am:
08873d0d7d am:
54460f0635 am:
10912a295f
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1649730
Change-Id: I3f8ea815c5c3de2678c11815ddaf41776d470552
Satya Tangirala [Thu, 8 Apr 2021 02:21:36 +0000 (02:21 +0000)]
Make vold use keystore2 instead of keymaster am:
e8de4ffd73 am:
7a8ac746a2 am:
b79360f80c
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1640885
Change-Id: I7445d17137f563c5cb3f6d8e62f4bb92da2c2fa1
Satya Tangirala [Thu, 8 Apr 2021 02:21:34 +0000 (02:21 +0000)]
Remove HardwareAuthToken support from vold::Keymaster am:
e13617100d am:
695fadddf3 am:
57e480b3d5
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1640884
Change-Id: Ia1d707a541b18d29ad9643294f6868d48422fa78
Satya Tangirala [Thu, 8 Apr 2021 01:36:42 +0000 (01:36 +0000)]
Merge changes from topic "vold-use-keystore2" am:
08873d0d7d am:
54460f0635
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1649730
Change-Id: I8a70c04881275aa5e3bf4cf629316870798df27a
Satya Tangirala [Thu, 8 Apr 2021 01:36:41 +0000 (01:36 +0000)]
Make vold use keystore2 instead of keymaster am:
e8de4ffd73 am:
7a8ac746a2
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1640885
Change-Id: I7a45fdb9ed25c5543d0a9dda80106241f90e53db
Satya Tangirala [Thu, 8 Apr 2021 01:36:40 +0000 (01:36 +0000)]
Remove HardwareAuthToken support from vold::Keymaster am:
e13617100d am:
695fadddf3
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1640884
Change-Id: I84747f3ea29f6b78f8f1a9bb11959a46ec8c3189
Satya Tangirala [Thu, 8 Apr 2021 00:52:41 +0000 (00:52 +0000)]
Merge changes from topic "vold-use-keystore2" am:
08873d0d7d
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1649730
Change-Id: Ie7db671fc7e90fa86cf84773786ea6afaab37a7f
Satya Tangirala [Thu, 8 Apr 2021 00:52:40 +0000 (00:52 +0000)]
Make vold use keystore2 instead of keymaster am:
e8de4ffd73
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1640885
Change-Id: I0a9b288902f5bb0f27d524dcf509ce461e4495fe
Satya Tangirala [Thu, 8 Apr 2021 00:52:35 +0000 (00:52 +0000)]
Remove HardwareAuthToken support from vold::Keymaster am:
e13617100d
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1640884
Change-Id: Id8528a10d976e94e8bdb4e308d91107b1afdced6
Satya Tangirala [Thu, 8 Apr 2021 00:48:19 +0000 (00:48 +0000)]
Merge changes from topic "vold-use-keystore2"
* changes:
Remove Keymaster::isSecure() and simplify callers
Make vold use keystore2 instead of keymaster
Remove HardwareAuthToken support from vold::Keymaster
Satya Tangirala [Tue, 23 Mar 2021 06:29:15 +0000 (23:29 -0700)]
Remove Keymaster::isSecure() and simplify callers
Now that isSecure() always returns true, we can remove it and simplify
all the callers (i.e. cryptfs). Refer to the commit description for
Iaebfef082eca0da8a305043fafb6d85e5de14cf8 for why this function always
return true.
Bug:
181910578
Test: Cuttlefish and bramble boot
Change-Id: I185dd8180bd7842b05295263f0b1aa7205329a88
Satya Tangirala [Mon, 1 Mar 2021 06:32:07 +0000 (22:32 -0800)]
Make vold use keystore2 instead of keymaster
Make vold use keystore2 for all its operations instead of directly using
keymaster. This way, we won't have any clients that bypass keystore2,
and we'll no longer need to reserve a keymaster operation for vold.
Note that we now hardcode "SecurityLevel::TRUSTED_ENVIRONMENT" (TEE)
when talking to Keystore2 since Keystore2 only allows TEE and STRONGBOX.
Keystore2 presents any SOFTWARE implementation as a TEE to callers when
no "real" TEE is present. As far as storage encryption is concerned,
there's no advantage to using a STRONGBOX when a "real" TEE is present,
and a STRONGBOX can't be present if a "real" TEE isn't, so asking
Keystore2 for a TEE is the best we can do in any situation.
The difference in behaviour only really affects the full disk encryption
code in cryptfs.cpp, which used to explicitly check that the keymaster
device is a "real" TEE (as opposed to a SOFTWARE implementation) before
using it (it can no longer do so since Keystore2 doesn't provide a way
to do this).
A little code history digging (
7c49ab0a0b in particular) shows that
cryptfs.cpp cared about two things when using a keymaster.
- 1) that the keys generated by the keymaster were "standalone" keys -
i.e. that the keymaster could operate on those keys without
requiring /data or any other service to be available.
- 2) that the keymaster was a non-SOFTWARE implementation so that things
would still work in case a "real" TEE keymaster was ever somehow
added to the device after first boot.
Today, all "real" TEE keymasters always generate "standalone" keys, and
a TEE has been required in Android devices since at least Android N. The
only two exceptions are Goldfish and ARC++, which have SOFTWARE
keymasters, but both those keymasters also generate "standalone" keys.
We're also no longer worried about possibly adding a "real" TEE KM to
either of those devices after first boot. So there's no longer a reason
cryptfs.cpp can't use the SOFTWARE keymaster on those devices.
There's also already an upgrade path in place (see
test_mount_encrypted_fs() in cryptfs.cpp) to upgrade the kdf that's
being used once a TEE keymaster is added to the device. So it's safe for
cryptfs.cpp to ask for a TEE keymaster from Keystore2 and use it
blindly, without checking whether or not it's a "real" TEE, which is why
Keymaster::isSecure() just returns true now. A future patch will remove
that function and simplify its callers.
Bug:
181910578
Test: cuttlefish and bramble boot. Adding, switching between, stopping
and removing users work.
Change-Id: Iaebfef082eca0da8a305043fafb6d85e5de14cf8
Satya Tangirala [Mon, 15 Mar 2021 22:33:08 +0000 (15:33 -0700)]
Remove HardwareAuthToken support from vold::Keymaster
HardwareAuthTokens are no longer used by vold since Android P. So remove
the auth token parameter from vold. This patch doesn't remove the token
from IVold.aidl, and the methods in VoldNativeService.cpp return an
error if a non-empty auth token is passed to them.
Bug:
181910578
Test: cuttlefish and bramble boot with patch
Change-Id: I1a9f54e10f9efdda9973906afd0a5de5a699ada5
Alan Stokes [Tue, 23 Mar 2021 19:14:47 +0000 (19:14 +0000)]
Merge "Vold will always bind mount obb and data dirs to lowerfs" am:
159a11f600 am:
fab8b2835b am:
00a48a7a99
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1647187
Change-Id: I4e22134f7590e94e619361b7d7814b6b4b0585f8
Alan Stokes [Tue, 23 Mar 2021 18:52:12 +0000 (18:52 +0000)]
Merge "Vold will always bind mount obb and data dirs to lowerfs" am:
159a11f600 am:
fab8b2835b
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1647187
Change-Id: I1cba8f70b47d325e7dd8ae005bff12db7a8f3b3f
Alan Stokes [Tue, 23 Mar 2021 18:12:19 +0000 (18:12 +0000)]
Merge "Vold will always bind mount obb and data dirs to lowerfs" am:
159a11f600
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1647187
Change-Id: I23b628c92b76f84511f0c8fc87b7b8aa52eb20a6
Alan Stokes [Tue, 23 Mar 2021 17:25:18 +0000 (17:25 +0000)]
Merge "Vold will always bind mount obb and data dirs to lowerfs"
Ricky Wai [Fri, 19 Mar 2021 15:35:49 +0000 (15:35 +0000)]
Vold will always bind mount obb and data dirs to lowerfs
So shell / root will always access to them directly not via fuse.
And zygote will be unmount these directories to prevent them being
abused for leaking app visibility.
Also, /mnt/androidwritable is not very useful now as it's the same as
/mnt/installer, but we should make shell / root to access /mnt/androidwritable
later and /mnt/installer should only access obb but not data dir.
Bug:
182997439
Test: Able to boot without errors
Test: df on /sdcard/Android/data shows it's no on fuse.
Change-Id: I2ad10b1e80c135f637d37ddf502ee010f89f4946
Ricky Wai [Fri, 19 Mar 2021 16:03:55 +0000 (16:03 +0000)]
Merge "Revert "Change mounting storage data and obb to on by default"" into sc-dev
Ricky Wai [Fri, 19 Mar 2021 14:21:46 +0000 (14:21 +0000)]
Revert "Change mounting storage data and obb to on by default"
Revert "Change mounting storage data and obb to on by default"
Revert submission
13469849-turn_on_iso-sc-dev
Reason for revert: Failing existing CTS b/
182843583
Reverted Changes:
If819ee161:Change mounting storage data and obb to on by defa...
I46a095448:Change mounting storage data and obb to on by defa...
Change-Id: Ic5156df1cac3a5ecd661b5f3bfa0095b2b767d5d
Martijn Coenen [Fri, 19 Mar 2021 09:44:14 +0000 (09:44 +0000)]
Merge "vold: do not acquire lock when abort fuse" am:
717c1926fc am:
d616d6e1ba am:
c678a95db2
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1639945
Change-Id: I7c52c6ce39a37ce8fbc719fd8f242d2106e344bf
Martijn Coenen [Fri, 19 Mar 2021 09:01:27 +0000 (09:01 +0000)]
Merge "vold: do not acquire lock when abort fuse" am:
717c1926fc am:
d616d6e1ba
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1639945
Change-Id: Id114cc272baabc99d6d9985761f7cec578dcd896
Martijn Coenen [Fri, 19 Mar 2021 08:42:45 +0000 (08:42 +0000)]
Merge "vold: do not acquire lock when abort fuse" am:
717c1926fc
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1639945
Change-Id: I137677f0625e3d46cc8d5a50aa3327e274676589
Martijn Coenen [Fri, 19 Mar 2021 08:21:00 +0000 (08:21 +0000)]
Merge "vold: do not acquire lock when abort fuse"
lijiazi [Wed, 17 Mar 2021 08:51:16 +0000 (16:51 +0800)]
vold: do not acquire lock when abort fuse
reboot maybe cause a deadlock scenario:
1:init->vdc->vold for abort_fuse blocked on futex hold by another
vold binder_x
2:binder_x blocked in binder_ioctl_write_read wait a dead service's
response
3:dead service is exiting and schedule a deferred work for put files
in binder_vma_close, after put files is completed, the binder_x will
eventually wake up
4:kworker execute binder_deferred_work is blocked on fuse request:
crash> bt 1707
PID: 1707 TASK:
ffffffe366175e80 CPU: 2 COMMAND: "kworker/2:4"
#0 [
ffffff801b8b3ac0] __switch_to at
ffffff962ce88a60
#1 [
ffffff801b8b3b10] __schedule at
ffffff962e2d3d30
#2 [
ffffff801b8b3b70] schedule at
ffffff962e2d3ff4
#3 [
ffffff801b8b3bc0] __fuse_request_send at
ffffff962d20e008
#4 [
ffffff801b8b3c00] fuse_request_send at
ffffff962d20deac
#5 [
ffffff801b8b3c30] fuse_flush at
ffffff962d217fa4
#6 [
ffffff801b8b3c80] filp_close at
ffffff962d0bd7b4
#7 [
ffffff801b8b3cb0] put_files_struct at
ffffff962d0e7658
#8 [
ffffff801b8b3d30] binder_deferred_func at
ffffff962dc9e60c
#9 [
ffffff801b8b3d90] process_one_work at
ffffff962cee761c
#10 [
ffffff801b8b3e00] worker_thread at
ffffff962cee7a68
#11 [
ffffff801b8b3e60] kthread at
ffffff962ceecc14
waiting for init abort_fuse
suggested by maco, do not acquire lock when abort fuse.
Test: reboot stress test
Change-Id: If6dd7f5e9c413a16ba047204c33d82d6ff41c4ae
Signed-off-by: lijiazi <lijiazi@xiaomi.com>
Eric Biggers [Tue, 16 Mar 2021 18:39:40 +0000 (18:39 +0000)]
Merge "KeyStorage: improve logging for key generation" into sc-dev
Eric Biggers [Tue, 16 Mar 2021 01:55:59 +0000 (01:55 +0000)]
Merge "KeyStorage: improve logging for key generation" am:
759022d0f1 am:
209084f877 am:
514cce99b8
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1638259
Change-Id: If6e766b8699fb2b05de7d33c1c6d3ce569a18b11
Eric Biggers [Tue, 16 Mar 2021 00:56:21 +0000 (00:56 +0000)]
Merge "KeyStorage: improve logging for key generation" am:
759022d0f1 am:
209084f877
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1638259
Change-Id: I1982ef32bdf67ccfa655f2f973a70dacbba284d4
Eric Biggers [Tue, 16 Mar 2021 00:17:24 +0000 (00:17 +0000)]
Merge "KeyStorage: improve logging for key generation" am:
759022d0f1
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1638259
Change-Id: I7d44cdbf632751092ed63ca7084b6ce26180a2bc
Eric Biggers [Mon, 15 Mar 2021 19:44:36 +0000 (12:44 -0700)]
KeyStorage: improve logging for key generation
The error messages that are printed when probing for rollback resistance
support on a device that doesn't support rollback-resistant keys can
make it sound like something is going wrong. Print a WARNING message
afterwards to try to make it clear what is going on. Also adjust or add
DEBUG messages when starting to generate each key so that it's easier to
distinguish the log messages for different key generation operations.
Bug:
182815123
Test: boot on device that doesn't support rollback-resistant keys and
check log.
Change-Id: I37a13eb5c1e839fb94581f3e7ec1cd8da0263d2b
Merged-In: I37a13eb5c1e839fb94581f3e7ec1cd8da0263d2b
Eric Biggers [Mon, 15 Mar 2021 23:46:54 +0000 (23:46 +0000)]
Merge "KeyStorage: improve logging for key generation"
Eric Biggers [Mon, 15 Mar 2021 19:44:36 +0000 (12:44 -0700)]
KeyStorage: improve logging for key generation
The error messages that are printed when probing for rollback resistance
support on a device that doesn't support rollback-resistant keys can
make it sound like something is going wrong. Print a WARNING message
afterwards to try to make it clear what is going on. Also adjust or add
DEBUG messages when starting to generate each key so that it's easier to
distinguish the log messages for different key generation operations.
Bug:
182815123
Test: boot on device that doesn't support rollback-resistant keys and
check log.
Change-Id: I37a13eb5c1e839fb94581f3e7ec1cd8da0263d2b
Ricky Wai [Mon, 15 Mar 2021 14:03:44 +0000 (14:03 +0000)]
Merge "Change mounting storage data and obb to on by default" into sc-dev
Treehugger Robot [Fri, 5 Mar 2021 20:39:30 +0000 (20:39 +0000)]
Merge "Avoid killing the FUSE daemon during unmount" am:
05bb5cc71e am:
5e953c70fc am:
a02960e5ed
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1614817
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I789eb902ba1a686753d85a6d57efeb5741423ce3
Treehugger Robot [Fri, 5 Mar 2021 19:57:22 +0000 (19:57 +0000)]
Merge "Avoid killing the FUSE daemon during unmount" am:
05bb5cc71e am:
5e953c70fc
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1614817
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I769ded970fbf021c241043063e34758bfebada98
Treehugger Robot [Fri, 5 Mar 2021 18:47:05 +0000 (18:47 +0000)]
Merge "Avoid killing the FUSE daemon during unmount" am:
05bb5cc71e
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1614817
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I25ce3bb0d699478ac00ca25a72d3b4dd0c63d2c1
Treehugger Robot [Fri, 5 Mar 2021 18:08:14 +0000 (18:08 +0000)]
Merge "Avoid killing the FUSE daemon during unmount"
Zim [Thu, 4 Mar 2021 12:21:24 +0000 (12:21 +0000)]
Avoid killing the FUSE daemon during unmount
The FUSE daemon is often holding fds on behalf of other apps and if a
volume is ejected the daemon would often get killed first while vold
is walking /proc/<pid>/fd to kill pids with open fds on the
volume. This is required for the volume unmount successfully.
To mitigate this, we avoid killing the FUSE daemon during the usual
/proc walk. This ensures that we first send SIGINT, SIGTERM and
SIGKILL to other apps first. There is an additional SIGKILL attempt
and on that last attempt, we kill the FUSE daemon as a last resort
Test: Manual
Bug:
171673908
Change-Id: I100d2ce4cb4c145cbb49e0696842e97dfba2c1c9
Abhijeet Kaur [Wed, 3 Mar 2021 13:32:00 +0000 (13:32 +0000)]
Merge "Remove unused mount modes and re-number the modes for consistency" am:
2d0ea90538 am:
6111dc99fe am:
7d0b75e407
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1605433
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I83fd80266a5b558b899963554950b20f5bf56e83
Abhijeet Kaur [Wed, 3 Mar 2021 13:02:43 +0000 (13:02 +0000)]
Merge "Remove unused mount modes and re-number the modes for consistency" am:
2d0ea90538 am:
6111dc99fe
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1605433
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: Ic29cce9e12067fdc7ea4827bb25210af7420cd4e
Abhijeet Kaur [Wed, 3 Mar 2021 11:12:54 +0000 (11:12 +0000)]
Merge "Remove unused mount modes and re-number the modes for consistency" am:
2d0ea90538
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1605433
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I958437ce02963f69c3498ef829e9bcbef27dabd4
Abhijeet Kaur [Wed, 3 Mar 2021 10:09:46 +0000 (10:09 +0000)]
Merge "Remove unused mount modes and re-number the modes for consistency"
Treehugger Robot [Tue, 2 Mar 2021 20:40:14 +0000 (20:40 +0000)]
Merge "Set a default ACL on /data/media/userId." am:
f6546171af am:
ca3fbd1e4b am:
541c8e03f2
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1603534
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I935e9217d592818c5df46941e2b303134a15f0f7
Treehugger Robot [Tue, 2 Mar 2021 19:47:14 +0000 (19:47 +0000)]
Merge "Set a default ACL on /data/media/userId." am:
f6546171af am:
ca3fbd1e4b
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1603534
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: Ib4f7ecc6b6e53fc9f61a4e83027ebb7a86b69b86
Treehugger Robot [Tue, 2 Mar 2021 19:03:54 +0000 (19:03 +0000)]
Merge "Set a default ACL on /data/media/userId." am:
f6546171af
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1603534
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I13d1ee215c805b25d73e3d39508ea05cdc60b703
Treehugger Robot [Tue, 2 Mar 2021 09:25:52 +0000 (09:25 +0000)]
Merge "Set a default ACL on /data/media/userId."
Treehugger Robot [Fri, 26 Feb 2021 06:07:25 +0000 (06:07 +0000)]
Merge "[vold] expose binder headers to dependent modules" am:
51ff06df22 am:
b06061cace am:
c0bd8a260d
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1607482
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: If7f00620faf15b159537820136df13b3ac628616
Treehugger Robot [Fri, 26 Feb 2021 05:24:15 +0000 (05:24 +0000)]
Merge "[vold] expose binder headers to dependent modules" am:
51ff06df22 am:
b06061cace
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1607482
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: Ie3321467c877bf1518594ea190cc109be9a0e483
Treehugger Robot [Fri, 26 Feb 2021 04:33:56 +0000 (04:33 +0000)]
Merge "[vold] expose binder headers to dependent modules" am:
51ff06df22
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1607482
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I32b3d8d656a07491b644c8fd05aa38b8031597a4
Treehugger Robot [Fri, 26 Feb 2021 03:35:10 +0000 (03:35 +0000)]
Merge "[vold] expose binder headers to dependent modules"
Songchun Fan [Thu, 25 Feb 2021 23:16:11 +0000 (23:16 +0000)]
[vold] expose binder headers to dependent modules
This allows libincremental_aidl-cpp to be built via cc_library instead
of aidl_interface.
BUG:
181266844
Test: builds
Change-Id: I4f0bc82629c0df758467aa074274b30f9dc6718d
Kalesh Singh [Wed, 24 Feb 2021 23:51:50 +0000 (23:51 +0000)]
Merge "vold: Use Wakelock::tryGet()" am:
8439ab27d6 am:
c08bc3b0b8 am:
bda3d905bd
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1600813
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I254c60898eb5a8b2aaa157fa31a4a439f6680a38
Kalesh Singh [Wed, 24 Feb 2021 22:58:01 +0000 (22:58 +0000)]
Merge "vold: Use Wakelock::tryGet()" am:
8439ab27d6 am:
c08bc3b0b8
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1600813
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: Ib0eb444a328513b3fbe4b9818268cff319c53ae3
Kalesh Singh [Wed, 24 Feb 2021 22:14:06 +0000 (22:14 +0000)]
Merge "vold: Use Wakelock::tryGet()" am:
8439ab27d6
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1600813
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I4b028c047da40cbbd20c0a99d4c957d87bfcf0c2
Kalesh Singh [Wed, 24 Feb 2021 18:49:58 +0000 (18:49 +0000)]
Merge "vold: Use Wakelock::tryGet()"
Abhijeet Kaur [Wed, 24 Feb 2021 12:33:25 +0000 (12:33 +0000)]
Remove unused mount modes and re-number the modes for consistency
Also, add REMOUNT_MODE_ANDROID_WRITABLE to return "/mnt/runtime/write".
Bug:
148454884
Test: builds
Change-Id: I5a38c88f46034c494604bb001cf4d4c400c8f73e
Martijn Coenen [Mon, 1 Feb 2021 07:57:02 +0000 (07:57 +0000)]
Set a default ACL on /data/media/userId.
This directory is used as a root for external storage on adopted storage
devices. It needs to be writable by processes holding the AID_MEDIA_RW
GID permission; in particular, it should be writable by the FUSE daemon.
On devices with sdcardfs, this was ensured automatically, because
sdcardfs presented a view of this directory that was writable, that we
could use for the FUSE daemon. But on devices without sdcardfs, the FUSE
daemon sees the raw filesystem and its permissions. This also means that
files created by the FUSE daemon will have their uid/gid set to the uid
of the FUSE daemon; to ensure these files stay writable to other system
applications that have AID_MEDIA_RW, use a default ACL to make sure the
gid stays AID_MEDIA_RW.
In particular, this fixes an issue with app cloning, where we want the
FUSE daemon of user 0 to be able to access the files of the app clone
user, and vice versa.
Bug:
154057120
Test: inspect uid/gid of /data/media/0 and contents
Change-Id: Ic5d63457ec917ea407b900dbb7773d89311780c6
Kalesh Singh [Mon, 22 Feb 2021 20:10:45 +0000 (15:10 -0500)]
vold: Use Wakelock::tryGet()
Acquiring a wakelock can fail if the suspend service is unavailable.
Explicitly check that wakelock was acquired before performing
operations that require the device to stay on.
Bug: b/
179229598
Test: Boot test on Pixel 4 device
Change-Id: If30087223e44098801a31d1bfd239ac22e891abe
Xin Li [Sat, 20 Feb 2021 13:38:43 +0000 (13:38 +0000)]
[automerger skipped] Mark ab/
7061308 as merged in stage. am:
0ee13dfc4f -s ours am:
9ee62187e7 -s ours
am skip reason: Change-Id I7124285f41c6a854ad5c86677bc94d78ddca5a97 with SHA-1
60537dad69 is in history
Original change: undetermined
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I2d2f9234a82f959148a047d2e6e91fd90182b96c
Xin Li [Sat, 20 Feb 2021 12:28:42 +0000 (12:28 +0000)]
[automerger skipped] Mark ab/
7061308 as merged in stage. am:
0ee13dfc4f -s ours
am skip reason: Change-Id I7124285f41c6a854ad5c86677bc94d78ddca5a97 with SHA-1
60537dad69 is in history
Original change: undetermined
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I50546bc29bc2fcd0dee816ded8d45d9b355c4eb1
Xin Li [Sat, 20 Feb 2021 08:24:42 +0000 (00:24 -0800)]
Mark ab/
7061308 as merged in stage.
Bug:
180401296
Merged-In: I7124285f41c6a854ad5c86677bc94d78ddca5a97
Change-Id: Icf8db3d8557a3835e0834eec134bb4b111ec3af0
Treehugger Robot [Fri, 19 Feb 2021 22:05:25 +0000 (22:05 +0000)]
Merge changes from topic "fsync-fixes" am:
6c36c6f421 am:
2a3e67a9e0 am:
85956f9525
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1590896
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I0d2bc6467b35b2df1aff79e4765bdd103c7b572a
Treehugger Robot [Fri, 19 Feb 2021 20:42:12 +0000 (20:42 +0000)]
Merge changes from topic "fsync-fixes" am:
6c36c6f421 am:
2a3e67a9e0
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1590896
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: Ibf2e04c47b38e917bf58afcfbd78b7a0a395c141
Treehugger Robot [Fri, 19 Feb 2021 19:54:09 +0000 (19:54 +0000)]
Merge changes from topic "fsync-fixes" am:
6c36c6f421
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1590896
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: Ifacc42ef9b4abe897a598e3cd8dcef4650b8f5ff
Treehugger Robot [Fri, 19 Feb 2021 19:23:47 +0000 (19:23 +0000)]
Merge changes from topic "fsync-fixes"
* changes:
Add syncs when creating parent directories
Sync parent directory in storeKeyAtomically()
Move pathExists() to Utils.cpp
Dhiraj Jadhav [Thu, 18 Feb 2021 19:33:21 +0000 (19:33 +0000)]
Merge "Revert "Revert "Revert "Set a default ACL on /data/media/userId."""" am:
a98846d8d5 am:
375884bd0a am:
e5d8fe2474
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1592902
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: Ia0b6cab9e43d08c5d5e1f6f37a9ce3f7fee35e0e
Dhiraj Jadhav [Thu, 18 Feb 2021 19:13:34 +0000 (19:13 +0000)]
Merge "Revert "Revert "Revert "Set a default ACL on /data/media/userId."""" am:
a98846d8d5 am:
375884bd0a
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1592902
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I38ed5d51a2f7712bf6a72b01f35e4c99a4edb43f
Dhiraj Jadhav [Thu, 18 Feb 2021 18:45:58 +0000 (18:45 +0000)]
Merge "Revert "Revert "Revert "Set a default ACL on /data/media/userId."""" am:
a98846d8d5
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1592902
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I7c3c8bd230bcc14471d127ddc2276634cd2b2a43
Dhiraj Jadhav [Thu, 18 Feb 2021 17:38:20 +0000 (17:38 +0000)]
Merge "Revert "Revert "Revert "Set a default ACL on /data/media/userId.""""
Dhiraj Jadhav [Thu, 18 Feb 2021 04:57:03 +0000 (04:57 +0000)]
Revert "Revert "Revert "Set a default ACL on /data/media/userId."""
This reverts commit
ea9681e4cdf30340b583dc27cb6c6474926ddaee.
Reason for revert: storage Permission causing b/
179362637 adb push to fail
Change-Id: Ibc1d8b5b685c22545b7e2d15de58059960b87e14
Eric Biggers [Tue, 16 Feb 2021 23:59:17 +0000 (15:59 -0800)]
Add syncs when creating parent directories
vold creates some directories for storing encryption keys if they don't
already exist, potentially including parent directories:
/metadata/vold/metadata_encryption
/data/misc/vold/volume_keys/$volume_uuid
/data/misc_de/$user/vold/volume_keys/$volume_uuid
/data/misc_ce/$user/vold/volume_keys/$volume_uuid
Currently fs_mkdirs() is used for this. However, fs_mkdirs() doesn't
include the fsync()s of the parent directories that are needed to ensure
that the new directories are persisted to disk right away -- which is
important for encryption keys.
Add a utility function MkdirsSync() which does what is needed, and make
the appropriate places call it.
Test: Booted and checked log for "Created directory" message.
Also ran 'atest vold_tests' to run the new unit test.
Change-Id: Ie9917b616433080139b8db3fd6877203ee6faf77
Eric Biggers [Tue, 16 Feb 2021 23:59:17 +0000 (15:59 -0800)]
Sync parent directory in storeKeyAtomically()
When an FBE or metadata encryption key is created, it's important that
it be persisted to disk right away; otherwise the device may fail to
boot after an unclean shutdown. storeKey() has the needed fsync()s.
However, storeKeyAtomically() doesn't, as it doesn't fsync() the parent
directory of key_path after it renames tmp_path to it.
Two callers do fsync() the parent directory themselves, but others
don't. E.g., the metadata encryption key doesn't get properly synced.
Therefore, add the needed fsync() to storeKeyAtomically() so that it
gets done for everyone.
Also remove the now-unneeded fsync()s from the two callers that did it
themselves.
Change-Id: I342ebd94f0a3d2bf3a7a443c35b6bda0f12e1ab2
Eric Biggers [Tue, 16 Feb 2021 23:59:17 +0000 (15:59 -0800)]
Move pathExists() to Utils.cpp
This is useful as a general utility function.
Change-Id: Id43fc106dc6c544c6e4ce65f10c7d4246b99e54a
Treehugger Robot [Tue, 16 Feb 2021 01:02:04 +0000 (01:02 +0000)]
Merge "[LSC] Add LOCAL_LICENSE_KINDS to system/vold" am:
810bcca4d0 am:
c7c9cfbf9f am:
64d5e281ad
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1589008
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: Ib75d7199304e2ed5da6d6145d8be1ce1f06e3327
Treehugger Robot [Tue, 16 Feb 2021 00:31:33 +0000 (00:31 +0000)]
Merge "[LSC] Add LOCAL_LICENSE_KINDS to system/vold" am:
810bcca4d0 am:
c7c9cfbf9f
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1589008
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: Ib8dbb252b72c8c7c102ed39747be613d16707121
Treehugger Robot [Mon, 15 Feb 2021 23:48:04 +0000 (23:48 +0000)]
Merge "[LSC] Add LOCAL_LICENSE_KINDS to system/vold" am:
810bcca4d0
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1589008
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: If9313dcc2a75e117374543fb9050aa1a7e0410f4
Treehugger Robot [Mon, 15 Feb 2021 23:21:47 +0000 (23:21 +0000)]
Merge "[LSC] Add LOCAL_LICENSE_KINDS to system/vold"
Bob Badour [Fri, 12 Feb 2021 22:24:10 +0000 (14:24 -0800)]
[LSC] Add LOCAL_LICENSE_KINDS to system/vold
Added SPDX-license-identifier-Apache-2.0 to:
Android.bp
bench/inodeop_bench/Android.bp
tests/Android.bp
Bug:
68860345
Bug:
151177513
Bug:
151953481
Test: m all
Exempt-From-Owner-Approval: janitorial work
Change-Id: I91823c7097d7bee39a363a0c0cc30de13e4d7539
Treehugger Robot [Sat, 13 Feb 2021 10:16:50 +0000 (10:16 +0000)]
Merge "Obtain incfs features early in the booting sequence." am:
915f6227a7 am:
a9838cc3d3 am:
ef885d3deb
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1585413
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I1af24c06a0fa58f11a754bfc22b43f0a7837e12b
Treehugger Robot [Sat, 13 Feb 2021 09:44:00 +0000 (09:44 +0000)]
Merge "Obtain incfs features early in the booting sequence." am:
915f6227a7 am:
a9838cc3d3
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1585413
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I04cd9b63a12e5ca9eacf2cb26be83a903893e1d5
Treehugger Robot [Sat, 13 Feb 2021 09:09:08 +0000 (09:09 +0000)]
Merge "Obtain incfs features early in the booting sequence." am:
915f6227a7
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1585413
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I695d55952de65a940602efd2387611e00bbde0ec
Treehugger Robot [Sat, 13 Feb 2021 06:32:14 +0000 (06:32 +0000)]
Merge "Obtain incfs features early in the booting sequence."
Alex Buynytskyy [Fri, 12 Feb 2021 03:09:10 +0000 (19:09 -0800)]
Obtain incfs features early in the booting sequence.
Has to be done before SystemConfig initialization to set correct
Incremental version feature.
Bug:
180010901
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest
Change-Id: I262d1f06aecb481f37bf82005c85fed02c476510
Ricky Wai [Mon, 25 Jan 2021 12:19:32 +0000 (12:19 +0000)]
Change mounting storage data and obb to on by default
Bug:
148049767
Test: atest AdoptableHostTest
Test: pass cts/cts_postsubmit_cf_stable-cloud-tf
Ignore-AOSP-First: Another CL on same topic has merge conflict from aosp to internal master
Change-Id: I46a0954489816df3651f2fc90d85b389fc38087f
Martijn Coenen [Mon, 1 Feb 2021 14:51:31 +0000 (14:51 +0000)]
Merge "Revert "Revert "Set a default ACL on /data/media/userId.""" am:
2e8f0d438b am:
62ed9d52db am:
dd6ebf8878
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1566179
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: Id79ce8f618bf52e166cb0d0dbec0856c1435581e
Martijn Coenen [Mon, 1 Feb 2021 14:06:58 +0000 (14:06 +0000)]
Merge "Revert "Revert "Set a default ACL on /data/media/userId.""" am:
2e8f0d438b am:
62ed9d52db
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1566179
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I6f8b60b5d0345ae7563446d90125bfbbc7b93371
Martijn Coenen [Mon, 1 Feb 2021 13:47:40 +0000 (13:47 +0000)]
Merge "Revert "Revert "Set a default ACL on /data/media/userId.""" am:
2e8f0d438b
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1566179
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I4464d2bcb23434832a7448ef59d079079a5c809d
Martijn Coenen [Mon, 1 Feb 2021 13:30:04 +0000 (13:30 +0000)]
Merge "Revert "Revert "Set a default ACL on /data/media/userId."""
Martijn Coenen [Mon, 1 Feb 2021 07:57:02 +0000 (07:57 +0000)]
Revert "Revert "Set a default ACL on /data/media/userId.""
This reverts commit
b276e80aec54c139587bbc510f503ced9414cf0f.
Reason for revert: b/
177926359 is now fixed
Change-Id: I8ec5d80a44fc9e491ab3430592e17d10a82f40ea
Seth Moore [Wed, 27 Jan 2021 04:19:46 +0000 (04:19 +0000)]
Merge "Add support for binding storage encryption to a seed" am:
6207c9cde4 am:
4c110af013 am:
0bdfada404
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1553317
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I496422108eedcb352d2fb45181ba4fc035c59e19
Treehugger Robot [Wed, 27 Jan 2021 04:16:35 +0000 (04:16 +0000)]
Merge "Specify version for aidl_interface explicitly" am:
8e10f698ef am:
5f6d86597e am:
97bc46aabd
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/
1560413
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I667a54723d93a39150bd9044c6d4306942a63ea2