Commit graph

3519 commits

Author SHA1 Message Date
Yurii Zubrytskyi
8777107734 Merge "Expose new IncFS interface through Vold" 2020-01-29 01:37:01 +00:00
Automerger Merge Worker
8c52523600 Merge "Refactor to use EncryptionPolicy everywhere we used to use raw_ref" am: fda79ddd82 am: 7c3b0af05e am: 23fdbc7937
Change-Id: I73aac44990227e35352c8fa40a4dc2265c68fb04
2020-01-29 01:01:50 +00:00
Automerger Merge Worker
23fdbc7937 Merge "Refactor to use EncryptionPolicy everywhere we used to use raw_ref" am: fda79ddd82 am: 7c3b0af05e
Change-Id: Id0b36a8bd1d7db487eb61823f27c5349581bf781
2020-01-29 00:39:55 +00:00
Paul Crowley
7c3b0af05e Merge "Refactor to use EncryptionPolicy everywhere we used to use raw_ref"
am: fda79ddd82

Change-Id: I0d1599b8a2baa141e1d08029f75e5e54f486cb14
2020-01-28 16:29:00 -08:00
Paul Crowley
fda79ddd82 Merge "Refactor to use EncryptionPolicy everywhere we used to use raw_ref" 2020-01-29 00:18:44 +00:00
Paul Crowley
77df7f207d Refactor to use EncryptionPolicy everywhere we used to use raw_ref
Test: Boots, no bad log messages: Cuttlefish with v2 policies, Taimen
Bug: 147733587
Change-Id: Ice4acac3236b6b7d90e60a2f57b46814aa1949f5
2020-01-28 11:17:58 -08:00
Zimuzo Ezeozue
ac95a2cc46 Merge "Allow external_storage or media_rw gid access /mnt/media_rw" 2020-01-28 11:04:35 +00:00
Martijn Coenen
db9eedad93 Merge "Automatically use correct lower paths for setupAppDir." 2020-01-28 09:15:22 +00:00
Yurii Zubrytskyi
3497cb5be5 Expose new IncFS interface through Vold
CL is a part of multi-repository topic and will be merged
to AOSP

Bug: 146080380
Test: manual

Change-Id: I09b33a34ff1ac7f6e415b7bd090c22e7df24d72d
2020-01-27 22:26:37 -08:00
Martijn Coenen
0a7e9925a6 Automatically use correct lower paths for setupAppDir.
When we're asked to create an app directory, find the corresponding
volume, and use the raw path of that volume to create the directory.
This ensures this will continue working on devices that don't have
sdcardfs.

Bug: 146419093
Test: manual test on cuttlefish
Change-Id: I91d735c1adbcca171e5af73aca0abd7ef396d0b7
2020-01-27 14:00:29 +01:00
Martijn Coenen
59d8a4f898 Merge "Add setProjectQuotaId to vold." 2020-01-27 08:57:52 +00:00
Zim
c9a2be4e3f Allow external_storage or media_rw gid access /mnt/media_rw
PublicVolumes are mounted on /mnt/media_rw/<volume>. Two categories of
apps need access to the mounts. Fortunately, they need access in
mutually exclusive scenarios.

1. The FUSE daemon needs access when serving content from app requests on
/storage/<volume>.

2. File managers (MANAGE_EXTERNAL_STORAGE permission) need access to
ureliable (USB OTG) volumes that are only available on the
/mnt/media_rw paths, i.e, they are not bind mounted into /storage
for apps.

Additionally, we want to ensure that file managers cannot access
/mnt/media_rw when there's a stacked FUSE volume on it. To do this,
we selectively change the mount gid of the /mnt/media_rw/<volume>
path:
-media_rw if it's a reliable volume, ie there's a stacked FUSE volume
-external_storage if it's an unreliable volume.

This ensures that file managers with their external_storage gid can
access unreliable volumes from /mnt/media_rw and cannot interfere with
the FUSE daemon when it's a reliable volume.

Test: adb shell sm set-force-adoptable [on|off] to set reliable or
unreliable volumes && mounting public volumes shows the correct
ACL on /mnt/media_rw/<volume>
Bug: 144914977

Change-Id: Iecf1a422d39e5137105b5a4946704858ce902a8a
2020-01-24 22:21:55 +00:00
Automerger Merge Worker
24362685f0 [automerger skipped] Merge "vold: Do not cache CE keys in vold" am: 432ca5af06 am: 8427b24fc5 am: d88fba70c7 -s ours
am skip reason: Change-Id I4cb1c035a472477e70c1ff5bf0b2c3fcfad495e5 with SHA-1 9ad51adeb9 is in history

Change-Id: Ifb41d27fa4006229a70cf95cd979f39a0646c84f
2020-01-24 17:45:07 +00:00
Automerger Merge Worker
d88fba70c7 Merge "vold: Do not cache CE keys in vold" am: 432ca5af06 am: 8427b24fc5
Change-Id: I52ee506f94ccab65fd3cc26a5fb0366e49e3d178
2020-01-24 17:30:14 +00:00
Automerger Merge Worker
8427b24fc5 Merge "vold: Do not cache CE keys in vold" am: 432ca5af06
Change-Id: I2ca8cd6aec19e5f736d4a796ed882ce5d704ded9
2020-01-24 17:16:28 +00:00
Paul Crowley
432ca5af06 Merge "vold: Do not cache CE keys in vold" 2020-01-24 17:02:49 +00:00
Martijn Coenen
fb42bc41eb Add setProjectQuotaId to vold.
To allow vold to set project IDs.

Bug: 146419093
Test: manual
Change-Id: Ibaf1908e0d35b15d9fd71a5b9c113f0f0c054f54
2020-01-24 15:35:20 +00:00
Automerger Merge Worker
bb972c0e0e Merge "Add support for casefolding and project quotas" am: f66ed18972 am: 37d8af2621 am: b9d3f62a36
Change-Id: I85c938b067336fbb19821ec31374d5eb67e909e0
2020-01-24 02:54:32 +00:00
Automerger Merge Worker
b9d3f62a36 Merge "Add support for casefolding and project quotas" am: f66ed18972 am: 37d8af2621
Change-Id: Ie233ba8045f5d294aa52476410e56335da2d8a52
2020-01-24 02:42:20 +00:00
Automerger Merge Worker
37d8af2621 Merge "Add support for casefolding and project quotas" am: f66ed18972
Change-Id: I5cba75000bcdbbc3bd3c6778994fea09d135aa2b
2020-01-24 02:27:01 +00:00
Daniel Rosenberg
f66ed18972 Merge "Add support for casefolding and project quotas" 2020-01-24 02:11:30 +00:00
Barani Muthukumaran
b1927c2a0a vold: Do not cache CE keys in vold
CE keys were cached in vold to support untrusted reset
by a device admin, this is now supported by Locksettingservice
using synthetic password. This change requires a secret to be
provided to retrieve the CE key and re-wrap without the secret
when user removes the credential.

Test: Set credential, remove credential, swipe to none
and vice-versa.
Bug: 26948053
Merged-In: I4cb1c035a472477e70c1ff5bf0b2c3fcfad495e5
Change-Id: I4cb1c035a472477e70c1ff5bf0b2c3fcfad495e5
2020-01-24 00:20:22 +00:00
Automerger Merge Worker
cc64e0c9af Merge "Fixed a wrong AIDL import path" am: aa038e2f4d am: b35ead2c3a am: 3c78c789d6
Change-Id: Ifccc45bfaf67cc31f12902f56bcc50da238f8901
2020-01-23 03:53:23 +00:00
Automerger Merge Worker
3c78c789d6 Merge "Fixed a wrong AIDL import path" am: aa038e2f4d am: b35ead2c3a
Change-Id: Ib43192a85298925ad4b7220a79930c2baaac5361
2020-01-23 03:41:43 +00:00
Jiyong Park
b35ead2c3a Merge "Fixed a wrong AIDL import path"
am: aa038e2f4d

Change-Id: I8f3bf6b512ac1a0509ceb17cfa35efd0af6581b8
2020-01-22 19:27:04 -08:00
Treehugger Robot
aa038e2f4d Merge "Fixed a wrong AIDL import path" 2020-01-23 00:57:58 +00:00
Zimuzo Ezeozue
7ca3481d92 Merge "Harden /mnt/{user,installer} permission bits" 2020-01-22 20:03:25 +00:00
Zim
1242be866c Harden /mnt/{user,installer} permission bits
These paths previously had 0755 permission bits
(/mnt/installer got its bits from the /mnt/user bind mount).
With such permissive bits, an unauthorized app can access a file using
the /mnt/installer path for instance even if access via /storage
would have been restricted.

In init.rc we create /mnt/user with 0755 initially, this is to keep
/sdcard working without FUSE. When mounting a FUSE filesystem, we
enusure in vold that /mnt/user is changed to 0700

Bug: 135341433
Test: adb shell ls -d /mnt/{user, installer}
Change-Id: Id387e34c5fd257858861246ad51486892653fb3a
2020-01-22 18:28:37 +00:00
Shawn Willden
ae8f06fe1c Update vold to use KM4.1
This CL updates vold to use the Keymaster 4.1 interface, but does not
yet call any of the new methods.

Test: Boot the device
Change-Id: I4574a2f6eead3b71d1e89488b496b734694620c7
2020-01-21 06:58:19 -07:00
Jiyong Park
50c3ab6ac1 Fixed a wrong AIDL import path
AIDL import path should point to a root directory where relative path to
an AIDL file encodes the fully qualified name of the type in the file.

Since libvold_binder imports types like
android.os.incremental.IncrementalFileSystemControlParcel which are
under frameworks/base/core/java, the import path should set to the path,
not to the sub directory that directly has the AIDL files.

Bug: 147918827
Test: m
Change-Id: Ic4941578813eced5a7eb59a0656c10b76e902515
2020-01-20 12:37:52 +09:00
Paul Crowley
e3d2051668 Merge "vold: Do not cache CE keys in vold" 2020-01-19 21:58:02 +00:00
Automerger Merge Worker
b47c53d83b Merge changes I1bbf480c,Icf2059cc am: 701a99834f am: 16f46cd3d5 am: 17a1295297
Change-Id: I4f0e5b0b7f95a00bf222f31597e1d3c7c5c016c1
2020-01-17 18:04:27 +00:00
Automerger Merge Worker
17a1295297 Merge changes I1bbf480c,Icf2059cc am: 701a99834f am: 16f46cd3d5
Change-Id: I3bd7beaa23e058b1d22ba86debd82fe727f4a92e
2020-01-17 17:53:48 +00:00
Automerger Merge Worker
16f46cd3d5 Merge changes I1bbf480c,Icf2059cc am: 701a99834f
Change-Id: I958b327f69f52cebf0e54e99b3c174ae30bce455
2020-01-17 17:40:39 +00:00
Oli Lan
701a99834f Merge changes I1bbf480c,Icf2059cc
* changes:
  Allow search permission on apex data directories.
  Change ownership of apex data directories to root.
2020-01-17 17:20:36 +00:00
Oli Lan
e1b3f5cd2d Allow search permission on apex data directories.
This gives x permission to all on the parent apex data directory
so that the data directories can be accessed by modules.

Bug: 147848983
Test: Build & flash, check permissions are correct
Change-Id: I1bbf480cbf9f9e758353237e333317516ad375ee
2020-01-17 11:37:31 +00:00
Oli Lan
9cfc404c2d Change ownership of apex data directories to root.
The apex data directories must be accessed by apexd in order for it to
perform snapshot and restore as part of the rollback process. As apexd
runs as root, this CL changes the apex data directories under misc_[ce|de]
to be owned by root.

Bug: 141148175
Test: Build and flash; check permissions are set correctly.
Change-Id: Icf2059cc9448364f834eef7892914a99883746a1
2020-01-17 11:11:06 +00:00
Zim
53d16d39dd Always symlink self/primary to /storage/emulated
This allows readlink(2) of /sdcard paths to work correctly
and return /storage/emulated/<userid> instead of
/mnt/user/<userid>/emulated/<userid>

Test: readlink /sdcard -> /storage/emulated/0
Bug: 135341433
Change-Id: I2cfa9cede02a93024e41d90f17c926a69ec6e052
2020-01-17 01:37:08 +00:00
Zimuzo Ezeozue
d0c7c52edc Merge "Handle failures after partial mounts" 2020-01-16 22:27:27 +00:00
Barani Muthukumaran
9ad51adeb9 vold: Do not cache CE keys in vold
CE keys were cached in vold to support untrusted reset
by a device admin, this is now supported by Locksettingservice
using synthetic password. This change requires a secret to be
provided to retrieve the CE key and re-wrap without the secret
when user removes the credential.

Test: Set credential, remove credential, swipe to none
and vice-versa.
Bug: 26948053
Change-Id: I4cb1c035a472477e70c1ff5bf0b2c3fcfad495e5
2020-01-16 12:16:25 -08:00
Automerger Merge Worker
100e15e8e2 [automerger skipped] DO NOT MERGE - Empty merge qt-qpr1-dev-plus-aosp-without-vendor (6129114) into stage-aosp-master am: 1119e4b809 am: 0925b02603 -s ours
am skip reason: subject contains skip directive

Change-Id: I751e639c592a780131d5e783355b3e23b5c3eac6
2020-01-16 01:58:32 +00:00
Automerger Merge Worker
0925b02603 DO NOT MERGE - Empty merge qt-qpr1-dev-plus-aosp-without-vendor (6129114) into stage-aosp-master am: 1119e4b809
Change-Id: Ib3631a92cc1b913d1ff6a80ae70e6eff6da8c067
2020-01-16 01:46:00 +00:00
Xin Li
1119e4b809 DO NOT MERGE - Empty merge qt-qpr1-dev-plus-aosp-without-vendor (6129114) into stage-aosp-master
Bug: 146167222
Change-Id: Ia5363ad8550ac868591e4e7cd49ee62670d3caef
2020-01-15 15:59:18 -08:00
Zim
df073f50d2 Handle failures after partial mounts
When we try mounting an EmulatedVolume, we may mount sdcardfs but fail
in any of the FUSE mounts, in this case we should unmount whatever
mounts we made during the mount.

Test: Intentionally causing a partial failure, verified that sdcardfs
gets unmounted
Bug: 147610762

Change-Id: I29ed044ed8ab8aa3dd83bc97a49eb3140ce4fe27
2020-01-15 16:10:54 +00:00
Daniel Rosenberg
477f3e5f4a Add support for casefolding and project quotas
This enables ext4 casefolding and project quotas for adopted storage
cards.

Test: Enable virtual sdcard, adopt, check options on formatted disk
Bug: 138321217
Bug: 138322712
Change-Id: I99c09283cd78c30237cf18ad9ae9384ba0c05396
2020-01-14 18:11:56 -08:00
Automerger Merge Worker
636123c523 Merge "Fix the overflow issue in Checkpoint" am: 6492a6abf6 am: e4c34d9cc3 am: c8425b0e8c
Change-Id: Idb11dfdd37c5813da6676894c35acb1503199553
2020-01-14 21:30:21 +00:00
Automerger Merge Worker
c8425b0e8c Merge "Fix the overflow issue in Checkpoint" am: 6492a6abf6 am: e4c34d9cc3
Change-Id: I82dece7b2fe00a31810120d63902048b2ffa6e8d
2020-01-14 21:14:50 +00:00
Qilin Tan
e4c34d9cc3 Merge "Fix the overflow issue in Checkpoint"
am: 6492a6abf6

Change-Id: I8991fd3bbe742fb87bc26bb6831280a73a2d5afb
2020-01-14 13:03:10 -08:00
Treehugger Robot
6492a6abf6 Merge "Fix the overflow issue in Checkpoint" 2020-01-14 20:47:23 +00:00
Martijn Coenen
3a2dbfee88 Bind mount write view of Android/obb for installers.
Installers will be allowed to write OBB for any application; this is not
easy to achieve on sdcardfs, where the GID of Android/obb is the same as
the GID of Android/data (app-private data), meaning giving installers
write access to Android/obb would also give them write access to
Android/data.

Instead, we create a /mnt/installer view, which is exactly the same as
/mnt/user, with the sole exception that the write sdcardfs view of
Android/obb is mounted on top. This is what will allow installers to
write there, while still being restricted with respect to app-private
data in Android/data.

Bug: 134706060
Test: atest AdoptableHostTest
Change-Id: If2b93870a877efef182bdc06466552a7527499ad
2020-01-11 19:50:25 +01:00