Commit graph

3345 commits

Author SHA1 Message Date
Yurii Zubrytskyi
e296f9cbf6 Merge "[vold] update with incfs_ndk.h" am: 29ee196fb5
Change-Id: If51dfb7c76c6593ecf31c2b42712c4ac114d2b83
2020-04-03 17:49:01 +00:00
Yurii Zubrytskyi
29ee196fb5 Merge "[vold] update with incfs_ndk.h" 2020-04-03 17:25:05 +00:00
Songchun Fan
27819332a8 [vold] update with incfs_ndk.h
BUG: 150470163
Test: atest PackageManagerShellCommandIncrementalTest
Change-Id: I5166c49cf48f353dab35e385571ada517cb751ac
Merged-In: I5166c49cf48f353dab35e385571ada517cb751ac
2020-04-01 16:27:37 -07:00
David Anderson
1c29e84b70 [automerger skipped] Block and wait for /dev/block/loop<N> to appear in case it was created asynchronously. am: 5ba8aeaa80 -s ours
am skip reason: Change-Id Id8616804bba622226ca21b8eff0d3eb577b4b7e0 with SHA-1 1dd5c4f787 is in history

Change-Id: I30e748f7983e661ba2abd9bbd2ec12dc453b1eb1
2020-03-30 09:00:10 +00:00
David Anderson
5ba8aeaa80 Block and wait for /dev/block/loop<N> to appear in case it was created asynchronously.
Bug: 134711825
Bug: 149462396
Test: StorageManagerTest
Change-Id: Id8616804bba622226ca21b8eff0d3eb577b4b7e0
Merged-In: Id8616804bba622226ca21b8eff0d3eb577b4b7e0
2020-03-27 20:16:44 +00:00
Yurii Zubrytskyi
58802279e2 Merge changes from topic "merge-incremental-vold" am: 10a372f1d2 am: 41c1c40afc
Change-Id: I542b7a48e7d94b78bf3fb01e44263e2b161df60f
2020-03-26 07:59:46 +00:00
Yurii Zubrytskyi
b52e063350 Expose new IncFS interface through Vold am: d05bcc8070 am: 636da65360
Change-Id: I349002a3eb80d962c86b24f89816c4ce76d5d65e
2020-03-26 07:59:44 +00:00
Yurii Zubrytskyi
41c1c40afc Merge changes from topic "merge-incremental-vold" am: 10a372f1d2
Change-Id: Id6fe791310761aa715fdf0e37760052a1534a4f0
2020-03-26 07:33:58 +00:00
Yurii Zubrytskyi
636da65360 Expose new IncFS interface through Vold am: d05bcc8070
Change-Id: Icbdb9f233850e70e8ca7c458fd30c4bea93a9923
2020-03-26 07:33:56 +00:00
Yurii Zubrytskyi
10a372f1d2 Merge changes from topic "merge-incremental-vold"
* changes:
  [vold] Add argument verification to IncFS methods
  Expose new IncFS interface through Vold
2020-03-26 07:23:11 +00:00
Yurii Zubrytskyi
9e7482ece1 [vold] Add argument verification to IncFS methods
+ Get rid of an extra string copy in path validation function

Bug: 152349257
Test: atest vold_tests
Change-Id: I03a8cab0dd6abd7d5c9dcbbc2acb651e818e6cd8
Merged-In: I03a8cab0dd6abd7d5c9dcbbc2acb651e818e6cd8
2020-03-25 17:21:49 -07:00
Yurii Zubrytskyi
d05bcc8070 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
Merged-In: I09b33a34ff1ac7f6e415b7bd090c22e7df24d72d
2020-03-24 14:26:27 -07:00
Xin Li
8db17c3111 DO NOT MERGE - Empty merge qt-qpr1-dev-plus-aosp@6304901 into stag-aosp-master am: 4e13a60b8d
Change-Id: Ic6e88b868f1e8de04713198d892411caab957906
2020-03-19 04:22:43 +00:00
Xin Li
4e13a60b8d DO NOT MERGE - Empty merge qt-qpr1-dev-plus-aosp@6304901 into stag-aosp-master
Bug: 151763422
Change-Id: I3f26efbcf61365bfac87aa83a0bc8a5dbb2d0a65
2020-03-18 19:40:59 -07:00
Automerger Merge Worker
b06025acb7 Merge "fskeyring & userspace reboot: support CE keys" am: eaa3443ad8 am: 91ba0c8fa4
Change-Id: I393e9464b2579cfd9b59596a70ca8c3881e0582d
2020-03-11 20:31:30 +00:00
Automerger Merge Worker
91ba0c8fa4 Merge "fskeyring & userspace reboot: support CE keys" am: eaa3443ad8
Change-Id: Ib22499ed549567b9ad12cd0f9c0ef5197724fee0
2020-03-11 20:12:14 +00:00
Nikita Ioffe
eaa3443ad8 Merge "fskeyring & userspace reboot: support CE keys" 2020-03-11 16:10:35 +00:00
Nikita Ioffe
1c6731c649 fskeyring & userspace reboot: support CE keys
During userspace reboot /data might be unmounted & remounted, meaning
that CE keys stored in fs-level keyring will be lost. In order to be
able to restore them, when installing new key to fs-level keyring, it's
also added to session-level keyring with type "fscrypt-provisioning".

Then when init_user0 is called during userspace reboot, vold will try to
load CE keys from the session-level keyring back into fs-level keyring
for all the users that were unlocked before the reboot.

If for any user vold fails to install the key, init_user0 will fail and
fallback to hard reboot will be triggered.

Test: set a pin pattern
Test: adb shell setprop sys.init.userdata_remount.force_umount 1
Test: adb shell svc power reboot userspace
Test: atest CtsUserspaceRebootHostSideTestCases
Bug: 143970043
Change-Id: I37603dc136c7ededc7b0381e4d730cb0ffd912b4
Merged-In: I37603dc136c7ededc7b0381e4d730cb0ffd912b4
(cherry picked from commit 1ee35cf002)
2020-03-11 11:46:46 +00:00
Automerger Merge Worker
af5251bc31 Merge "Use the blk_device supplied by vdc encryptFstab" am: 3b3a13a81a am: eeb005eb7d
Change-Id: If29abc839cb196072cccc7024b499ef5d54a0f45
2020-03-05 16:32:43 +00:00
Automerger Merge Worker
eeb005eb7d Merge "Use the blk_device supplied by vdc encryptFstab" am: 3b3a13a81a
Change-Id: I7967532a151eb373b878e7723e73df67cce1061f
2020-03-05 16:18:03 +00:00
Paul Crowley
3b3a13a81a Merge "Use the blk_device supplied by vdc encryptFstab" 2020-03-05 15:59:18 +00:00
Automerger Merge Worker
21505d9536 Merge "fskeyring & userspace reboot: support DE keys" am: 3b719ed32e am: ac589ee784
Change-Id: I50a54e3ac6a873930d2c3b0ee62ca389100b0787
2020-03-04 15:33:10 +00:00
Automerger Merge Worker
ac589ee784 Merge "fskeyring & userspace reboot: support DE keys" am: 3b719ed32e
Change-Id: I23ff1535eacf875561c6fef250b431fe17b6dc14
2020-03-04 15:19:40 +00:00
Nikita Ioffe
3b719ed32e Merge "fskeyring & userspace reboot: support DE keys" 2020-03-04 15:02:23 +00:00
Nikita Ioffe
f0550af103 fskeyring & userspace reboot: support DE keys
During userspace reboot /data might be unmounted, which means that if
device supports filesystem keyring, DE keys will be lost and are needed
to be re-installed.

Test: adb shell setprop sys.init.userdata_remount.force_umount 1
Test: adb shell svc power reboot userspace
Test: atest CtsUserspaceRebootHostSideTestCases
Bug: 143970043
Change-Id: I153caa1d7c373b3c906a34f1184c681e52854a9d
Merged-In: I153caa1d7c373b3c906a34f1184c681e52854a9d
(cherry picked from commit 1eaea5a6a2)
2020-03-04 12:18:53 +00:00
Automerger Merge Worker
96ef136654 Merge "umount /data/user/0 before umount /data" am: 3a0fd35b62 am: 20f9f29d53
Change-Id: If73d45b2048ef3031f1f38180735ab542b7dbdfd
2020-03-04 05:09:52 +00:00
Automerger Merge Worker
20f9f29d53 Merge "umount /data/user/0 before umount /data" am: 3a0fd35b62
Change-Id: Ibb3aa685585e8dab22f504a7f862cad5e551ca96
2020-03-04 04:53:16 +00:00
Treehugger Robot
3a0fd35b62 Merge "umount /data/user/0 before umount /data" 2020-03-04 04:34:46 +00:00
Hyangseok Chae
3cf3233bac umount /data/user/0 before umount /data
FDE device has shut down and restart the framework.
But restart is not triggered due to umount fail.
umount /data fail with "device is busy"
It is because bind mount /data/data to /data/user/0

We need umount /data/user/0 before umount /data

Bug: 148004718
Test: Flash GSI and check boot with FDE and FBE device.
Change-Id: I919f9e31a9d2d745b297a7ab99b399aa9b293b39
2020-03-04 02:27:50 +00:00
Paul Crowley
48aa90cd6b Use the blk_device supplied by vdc encryptFstab
fs_mgr may put other dm devices on top of the raw disk, such as for
checkpointing, and it hands metadata encryption the uppermost device in
vdc. That's what should be encrypted, not the raw disk.

Bug: 150354860
Test: Treehugger
Change-Id: I279f087b1b7aded40c5a62281154851ce970ba70
2020-03-02 13:52:22 -08:00
Automerger Merge Worker
65f67bb35b Merge "Use optional for nullable types" am: deb7085453 am: c63694c6e1
Change-Id: I29d0ba8265692bc7234b4f72cd1c0fd0324c8834
2020-02-27 03:35:55 +00:00
Automerger Merge Worker
c63694c6e1 Merge "Use optional for nullable types" am: deb7085453
Change-Id: Iea4d8e042d65e2ed1befa6dc18c822f2982c41ab
2020-02-27 03:22:54 +00:00
Jooyung Han
deb7085453 Merge "Use optional for nullable types" 2020-02-27 03:06:14 +00:00
Jooyung Han
d75a10ac6f Use optional for nullable types
AIDL generates optional<T> for nullable T types for C++, which is more
efficient and idomatic and easy to use.

Bug: 144773267
Test: build/flash/boot
Merged-In: I98549c8614c9152d5d45e2f1f33f2f3c31a9bbbf
Change-Id: I98549c8614c9152d5d45e2f1f33f2f3c31a9bbbf
(cherry picked from commit 0568fd287cfc0affc8e985f21da3793cdda286a3)
2020-02-20 17:32:21 +09:00
Automerger Merge Worker
f0bea38daa Merge "Make CTS not HEH the default post Q" am: 39969f0288 am: 17d85205bd
Change-Id: I0c3114a77c37b30e542c45fc4d4d6ea592444b1a
2020-02-19 23:37:01 +00:00
Automerger Merge Worker
17d85205bd Merge "Make CTS not HEH the default post Q" am: 39969f0288
Change-Id: I0cb0430214ab69656c6e7f3116194b63eb54672b
2020-02-19 23:20:59 +00:00
Treehugger Robot
39969f0288 Merge "Make CTS not HEH the default post Q" 2020-02-19 23:04:37 +00:00
Paul Crowley
eb241a1d65 Make CTS not HEH the default post Q
Making HEH the default was always a mistake and a giant foot-gun.
Let's make life easier for people by making the default depend on
first_api_level, so it's automatically set up right for new devices
without breaking old ones. Also use v2 fscrypt keys instead of v1 post
Q.

Bug: 147107322
Test: Various Cuttlefish configurations
Change-Id: I5432bdfd6fec6ed34e7f9ab7cdd32cdeb2a03472
2020-02-19 10:27:48 -08:00
Automerger Merge Worker
7b9b164946 Merge "Fix unaligned access to auth token user_id" am: 21a17b091e am: 01759662fd
Change-Id: I224885ade242636a9806574c164f34494a8f377f
2020-02-19 00:06:04 +00:00
Automerger Merge Worker
923309aae2 Merge "Remove unused code in VoldUtil.h" am: e19189bd7f am: b6421644ec
Change-Id: If68c55c8e6f3db5e00e08f958845ceab8cf36f4e
2020-02-19 00:05:34 +00:00
Automerger Merge Worker
c14f46d114 Merge changes from topics "metadata_wrapped_key_aosp", "volume_metadata" am: 36fd1ebfae am: 6891eb7e2d
Change-Id: I39904b704f983124afd8ff62cd3b863fd600e6a2
2020-02-19 00:05:22 +00:00
Automerger Merge Worker
01759662fd Merge "Fix unaligned access to auth token user_id" am: 21a17b091e
Change-Id: If1b44823f6758c9428b5874b2629579f384399b7
2020-02-18 23:40:09 +00:00
Automerger Merge Worker
b6421644ec Merge "Remove unused code in VoldUtil.h" am: e19189bd7f
Change-Id: I52b8e04f85890a1a320c47a191bf1c0429e058a4
2020-02-18 23:40:04 +00:00
Automerger Merge Worker
6891eb7e2d Merge changes from topics "metadata_wrapped_key_aosp", "volume_metadata" am: 36fd1ebfae
Change-Id: Ieb478426e40feffcefd3a5e478e5e1c5d72539b7
2020-02-18 23:39:37 +00:00
Paul Crowley
21a17b091e Merge "Fix unaligned access to auth token user_id" 2020-02-18 23:18:46 +00:00
Paul Crowley
e19189bd7f Merge "Remove unused code in VoldUtil.h" 2020-02-18 23:18:30 +00:00
Paul Crowley
36fd1ebfae Merge changes from topics "metadata_wrapped_key_aosp", "volume_metadata"
* changes:
  On newer devices, use dm-default-key to encrypt SD cards
  vold: Wrapped key support for metadata encryption
  Refactor: make makeGen local
2020-02-18 23:17:07 +00:00
Paul Crowley
886e572009 On newer devices, use dm-default-key to encrypt SD cards
The dm-crypt solution requires a kernel patch that won't be present in
the GKI kernel, while the new metadata encryption system in the GKI
kernel solves this problem in a much cleaner way.

Test: create private volume on Cuttlefish, setting property both ways.
Bug: 147814592
Change-Id: Ie02bd647c38d8101af2bbc47637f65845d312cea
2020-02-18 13:01:00 -08:00
Barani Muthukumaran
312b7df621 vold: Wrapped key support for metadata encryption
metadata_encryption fstab option provides details on the cipher
and flags used for metadata encryption. wrappedkey_v0 is provided
to dm-default-key dm device when a wrapped key is used. The
inline encryption hardware unwraps the key and derives the
encryption key used to encrypt metadata without returning the key
in the clear to software.

Bug: 147733587
Test: FBE with metadata encryption using wrapped keys.
Change-Id: Ibf69bdc12bb18d2f0aef8208e65f3a8dececfd2a
2020-02-18 12:51:06 -08:00
Paul Crowley
249c2fb4aa Refactor: make makeGen local
No need for KeyUtil to know how to make a KeyGeneration, it's cleaner
if each module handles it separately. Also, create a CryptoOptions
structure to track metadata encryption options, and simplify legacy
cipher/option handling.

Test: Treehugger
Bug: 147814592
Change-Id: I740063882914097329ff72348d0c0855c26c7aab
2020-02-18 12:49:36 -08:00