Commit graph

3463 commits

Author SHA1 Message Date
Risan
82e90de23d Add disk for StubVolume
StubVolume is a volume type for ARC++ external storage. Named StubVolume
because it is managed from outside Android (not through Android kernel).

Previously, StubVolume is a diskless volume. However, as mentioned in
jsharkey@ email, a disk is needed for StubVolume to hold "kInternal"
(external storage type that is "external" from Android perspective,
but is "internal" to the device. For example shared directory from
ChromeOS to Android) and "kIndexable" (whether or not a disk should be
indexed by MediaStore).

The addition of disk means we could expose the createStubVolume API to
add a disk flags, which is also introduced in this CL.

Both kInternal and kIndexable will be introduced in separate CL.

Bug: 132796154
Test: Mount/unmount ARC++ removable device in ChromeOS.
Change-Id: I8b77fa1cf50ab38a2892272154dafdb78f079378
2020-02-12 07:42:40 +00:00
Automerger Merge Worker
d74f4949de Merge "Have vold inform keymaster that early boot ended" am: 68b9fb10ae am: fce0d92ce4 am: bf352873ad
Change-Id: I3aaebfcca61c92667de114d477cbbcf35d23bcd9
2020-02-12 04:50:35 +00:00
Automerger Merge Worker
bf352873ad Merge "Have vold inform keymaster that early boot ended" am: 68b9fb10ae am: fce0d92ce4
Change-Id: If58cc1911c477ac9bed03fc39952a573db71651e
2020-02-12 04:35:10 +00:00
Automerger Merge Worker
fce0d92ce4 Merge "Have vold inform keymaster that early boot ended" am: 68b9fb10ae
Change-Id: Ic113eea7d3282084f1eae308ae1b6df931bd7a8c
2020-02-12 04:25:19 +00:00
Treehugger Robot
68b9fb10ae Merge "Have vold inform keymaster that early boot ended" 2020-02-12 04:07:43 +00:00
Automerger Merge Worker
861a70b0ea [automerger skipped] Merge "Update vold to use KM4.1" am: 6c5f302a90 am: 53f8e2df82 am: 3660bf983c -s ours
am skip reason: Change-Id I4574a2f6eead3b71d1e89488b496b734694620c7 with SHA-1 ae8f06fe1c is in history

Change-Id: I98403470def2e60e7ff5b8b6ee55c5a34f4e463a
2020-02-12 01:24:05 +00:00
Automerger Merge Worker
3660bf983c Merge "Update vold to use KM4.1" am: 6c5f302a90 am: 53f8e2df82
Change-Id: I808df576abeec8ce2dd5fc8ea9d4784f4c8b6b0d
2020-02-12 01:11:28 +00:00
Automerger Merge Worker
53f8e2df82 Merge "Update vold to use KM4.1" am: 6c5f302a90
Change-Id: I5393adf2503586c87414a302fa24d381863bccbf
2020-02-12 01:06:54 +00:00
Treehugger Robot
6c5f302a90 Merge "Update vold to use KM4.1" 2020-02-12 00:56:18 +00:00
Shawn Willden
2b1ff5aaab Have vold inform keymaster that early boot ended
Just before mounting partition(s) not verified by verified boot, vold
should notify keymaster that early boot has ended so it won't allow
EARLY_BOOT_ONLY keys to be created or used.

Test: VtsHalKeymasterV4_1TargetTest
Change-Id: I74ffec8d5b33f01e62f845a8fc824b3a3cad50f3
Merged-In: I74ffec8d5b33f01e62f845a8fc824b3a3cad50f3
2020-02-11 15:51:04 -07:00
Shawn Willden
35f0f22c9b 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
Merged-In: I4574a2f6eead3b71d1e89488b496b734694620c7
2020-02-11 15:51:04 -07:00
Martijn Coenen
04bb17f112 Use a regex to create application directories.
A regex allows us to be more specific in what kind of directories we
accept here, which in turn makes it easier to correctly create them.

Bug: 146419093
Test: atest FuseDaemonHostTest
Change-Id: Icb8911f6516eab81b9bbd567c7287be9f605e8b0
2020-02-11 14:22:30 +01:00
Automerger Merge Worker
3fcbdbff5f Merge "Use std::string to return crypto device, not char *" am: 80731b0975 am: 2381810b99 am: 1541f9f32b
Change-Id: I68cf7bfc6ce642d46d874bb44694109b1f43258e
2020-02-11 01:18:30 +00:00
Automerger Merge Worker
1541f9f32b Merge "Use std::string to return crypto device, not char *" am: 80731b0975 am: 2381810b99
Change-Id: Ic7683749f4974ccdf251b7351110a1e3663536b7
2020-02-11 01:03:00 +00:00
Automerger Merge Worker
2381810b99 Merge "Use std::string to return crypto device, not char *" am: 80731b0975
Change-Id: I4cdc6e59713a945f9fc7b6e9d8c765e78c44b9cb
2020-02-11 00:49:53 +00:00
Paul Crowley
80731b0975 Merge "Use std::string to return crypto device, not char *" 2020-02-11 00:37:26 +00:00
Martijn Coenen
1f40bea0bb Merge "Add TEST_MAPPING for vold." 2020-02-10 09:09:29 +00:00
Martijn Coenen
b77ad3a4cc Add TEST_MAPPING for vold.
Start with FuseDaemonHostTest and AdoptableHostTest, since these heavily
rely on functionality implemented in FUSE to work correctly.

Bug: 149095627
Test: run atest in system/vold
Change-Id: Ia583505aae260584897b0ea80c419b0e34f04735
2020-02-10 08:57:30 +01:00
Martijn Coenen
a0213ff0c3 Merge "Add SetQuotaInherit API." 2020-02-10 07:54:30 +00:00
Automerger Merge Worker
cc733959f6 Merge "Refactor: make cryptfs.h smaller" am: 98c501d28e am: 645c2f40a0 am: ebbabdc8fb
Change-Id: If8c533aa196969adf38dcbf85673cebb39a79024
2020-02-08 02:27:49 +00:00
Automerger Merge Worker
ebbabdc8fb Merge "Refactor: make cryptfs.h smaller" am: 98c501d28e am: 645c2f40a0
Change-Id: I5fb7f528186b6a678a02febd9e866ca4ae467dd4
2020-02-08 02:15:04 +00:00
Automerger Merge Worker
645c2f40a0 Merge "Refactor: make cryptfs.h smaller" am: 98c501d28e
Change-Id: I85d5bacfc08245397cb4f8aa71406bfeed961c19
2020-02-08 01:50:57 +00:00
Treehugger Robot
98c501d28e Merge "Refactor: make cryptfs.h smaller" 2020-02-08 01:34:29 +00:00
Paul Crowley
81796e9dce Use std::string to return crypto device, not char *
Bug: 147814592
Test: can create private volume on Cuttlefish
Change-Id: Ic2bca81c0f0319e1b988e9204a2f4e91af57d157
2020-02-07 11:27:49 -08:00
Paul Crowley
73be12dcd5 Refactor: make cryptfs.h smaller
Move most of it into cryptfs.cpp, and include cryptfs.h in fewer files.

Bug: 147814592
Test: Treehugger
Change-Id: Ia3592d73e7abc1f07a60538e0978a3033bdea7de
2020-02-07 11:16:12 -08:00
Zim
a13d81bbf5 Create Android/media dirs
I3a879089422c7fc449b6a3e6f1c4b386b86687a4 enforces some gids on the
Android/ dirs but left out Android/media. We now create it

Test: atest FuseDaemonHostTest#testListFilesFromExternalMediaDirectory
Bug: 149072341
Change-Id: I260c414906cd491a6bdd83522ff45f8663e15604
2020-02-07 17:42:47 +00:00
Martijn Coenen
5fe1b16330 Add SetQuotaInherit API.
This allows setting the "inherit project ID" flags on directories; in
our case, we want to set this on the root of the lower filesystem, eg
"/data/media/0".

Bug: 146419093
Test: manual invocation works
Change-Id: Ic74588fd972d464e7021bef953da0e5aaafc4286
2020-02-06 18:57:47 +01:00
Martijn Coenen
ba9868bd78 Set correct quota project ID on application directories.
Use PrepareAppDirsFromRoot() to setup the quota project ID on
application-specific directories correctly. App directories use
AID_EXT_GID_START + their application ID offset, whereas cache
directories use AID_CACHE_GID_START. This is consistent with the GIDs
sdcardfs used to label these directories with.

Bug: 146419093
Test: verified project IDs with lsattr -p
Change-Id: Idca8a30d185012efb0d19ceb9b346b9a4de34f18
2020-02-04 13:02:51 +01:00
Martijn Coenen
62a4b279ab Setup Android/, Android/data and Android/obb dirs correctly.
Normally sdcardfs takes care of setting up these directories on-demand,
for example when an app requests its private data directory to be
created. On devices without sdcardfs however, we ourselves need to make
sure to setup the UID/GID of these directories correctly.

Introduce a new PrepareAndroidDirs() function which sets the dirs up
correctly. On devices without sdcardfs, that means:

Path              UID         GID         mode
/Android          media_rw    media_rw     771
/Android/data     media_rw    ext_data_rw  771
/Android/obb      media_rw    ext_obb_rw   771

Bug: 146419093
Test: wipe Android/, reboot, with and without sdcardfs, verify
      contents

Change-Id: I3a879089422c7fc449b6a3e6f1c4b386b86687a4
2020-02-04 13:02:49 +01:00
TreeHugger Robot
bff86152e5 Merge "Harden /mnt/pass_through paths" 2020-02-03 08:13:47 +00:00
Automerger Merge Worker
7b40c8e2b2 Merge changes from topics "dm-default-key-v2", "metadata_cipher" am: f60e947438 am: 0560c27092 am: 5aac6ab55f
Change-Id: Ia65e525982d7f95416345c0004f79e7ecc7e026e
2020-02-01 16:40:35 +00:00
Automerger Merge Worker
5aac6ab55f Merge changes from topics "dm-default-key-v2", "metadata_cipher" am: f60e947438 am: 0560c27092
Change-Id: I0c34298e89be72caf597c964ceeb7f3396abe20b
2020-02-01 16:29:52 +00:00
Automerger Merge Worker
0560c27092 Merge changes from topics "dm-default-key-v2", "metadata_cipher" am: f60e947438
Change-Id: I3e27ed3481542e5e6fe0db2c872d745151e50765
2020-02-01 16:19:45 +00:00
Treehugger Robot
f60e947438 Merge changes from topics "dm-default-key-v2", "metadata_cipher"
* changes:
  Set metadata cipher in fstab
  Add support for v2 of dm-default-key
2020-02-01 16:12:30 +00:00
Automerger Merge Worker
98ffa995d3 Merge "Rename key_dir to metadata_key_dir and refactor" am: a7463139cd am: 8cf1eda025 am: 48c403b820
Change-Id: I4df8daf1210a31b4ae0e32ee8c04f8f7acdc827b
2020-01-31 22:25:04 +00:00
Automerger Merge Worker
48c403b820 Merge "Rename key_dir to metadata_key_dir and refactor" am: a7463139cd am: 8cf1eda025
Change-Id: I0933c434c9c63e15f8af648aa99250eea95aa3bd
2020-01-31 22:14:21 +00:00
Automerger Merge Worker
8cf1eda025 Merge "Rename key_dir to metadata_key_dir and refactor" am: a7463139cd
Change-Id: I14535278f6e2b0ffe6c322a2e9bd7e2ae608105f
2020-01-31 21:59:05 +00:00
Paul Crowley
a7463139cd Merge "Rename key_dir to metadata_key_dir and refactor" 2020-01-31 21:49:13 +00:00
Zim
26eec7049b Harden /mnt/pass_through paths
Even though /mnt/pass_through itself is 700 root root, the paths under
it are quite permissive. Now, change them from 755 to 710 root
media_rw since the FUSE daemon is the only one that should access it
and it has media_rw gid

Test: manual
Bug: 135341433
Change-Id: I743c014f2c0273c68a1cead7f4331b55a3abcb4e
2020-01-31 16:10:06 +00:00
Paul Crowley
84e84c5f33 Set metadata cipher in fstab
Bug: 147814592
Test: Cuttlefish can use adiantum
Change-Id: I6805ae4acff4dd1ff7cecff9153dbf29e0274165
2020-01-30 17:20:27 -08:00
Paul Crowley
92a14b6b16 Add support for v2 of dm-default-key
Version 2 of dm-default-key has an extra parameter and always sets the
DUN.

Bug: 147814592
Test: Cuttlefish boots with keydirectory flag
Test: Crosshatch formatted before this change boots after it
Change-Id: I59081e385324d2e34a5f252286a97938d6ffb79b
2020-01-30 17:20:27 -08:00
Paul Crowley
c9b92f0c17 Rename key_dir to metadata_key_dir and refactor
Bug: 147814592
Test: Crosshatch boots
Change-Id: I9fce0ea5da9c81c2e4e9cf97b75c1cba821adf9e
2020-01-30 16:02:37 -08:00
Zimuzo Ezeozue
262c5dfbce Merge "Allow media_rw access to /mnt/user" 2020-01-29 08:07:13 +00:00
Zim
4dd47090a5 Allow media_rw access to /mnt/user
This allows the FUSE daemon (with media_rw) explicitly use /mnt/user
paths for redaction.

Test: atest FuseDaemonHostTest#testVfsCacheConsistency
Change-Id: If5b5f5aa6a0ce7c8e2fd300ff6146b345b25cf04
2020-01-29 02:44:46 +00:00
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