Commit graph

5077 commits

Author SHA1 Message Date
Eric Biggers
9f749bcb19 Merge "Ignore too-early earlyBootEnded on FDE devices" am: a3bd31c170 am: 979429e6c3
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1747633

Change-Id: Iff37e24d06efedebf682c37b79fdc8ec868b0739
2021-06-25 20:11:40 +00:00
Eric Biggers
979429e6c3 Merge "Ignore too-early earlyBootEnded on FDE devices" am: a3bd31c170
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1747633

Change-Id: Ida62bd5cdab40ce459ba45d20a13c09545b4d938
2021-06-25 19:57:37 +00:00
Eric Biggers
2ddc1338d7 Ignore too-early earlyBootEnded on FDE devices
Don't call IKeystoreMaintenance::earlyBootEnded() too early on FDE
devices, so that keystore2 doesn't have to be restarted.

Bug: 192090857
Test: Tested FDE on Cuttlefish, both first and non-first boots.
      Verified via log that earlyBootEnded is now called only when it
      should be, and that keystore2 no longer has to be restarted.
Change-Id: I03f816db194a8276ad19ca99b3c8894e8a5fed23
(cherry picked from commit 4859e0ca0f)
Merged-In: I03f816db194a8276ad19ca99b3c8894e8a5fed23
2021-06-25 12:44:08 -07:00
Eric Biggers
a3bd31c170 Merge "Ignore too-early earlyBootEnded on FDE devices" 2021-06-25 19:43:02 +00:00
Eric Biggers
4859e0ca0f Ignore too-early earlyBootEnded on FDE devices
Don't call IKeystoreMaintenance::earlyBootEnded() too early on FDE
devices, so that keystore2 doesn't have to be restarted.

Bug: 192090857
Test: Tested FDE on Cuttlefish, both first and non-first boots.
      Verified via log that earlyBootEnded is now called only when it
      should be, and that keystore2 no longer has to be restarted.
Change-Id: I03f816db194a8276ad19ca99b3c8894e8a5fed23
2021-06-25 12:40:21 -07:00
Treehugger Robot
eef934fa9e Merge "Replace writepid with task_profiles command for cgroup migration" am: 73a54f653b am: 545957abfe am: 7bff55552f
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1740142

Change-Id: Ic110670412331e5d8f9100c890367243823b0b4d
2021-06-23 22:17:08 +00:00
Treehugger Robot
7bff55552f Merge "Replace writepid with task_profiles command for cgroup migration" am: 73a54f653b am: 545957abfe
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1740142

Change-Id: Iedea33f82eb260baa60fdb65bc6de3b849e0c579
2021-06-23 22:03:08 +00:00
Treehugger Robot
545957abfe Merge "Replace writepid with task_profiles command for cgroup migration" am: 73a54f653b
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1740142

Change-Id: I323edcd23a26ffdef59a45e9cd19574c19514ce1
2021-06-23 21:51:39 +00:00
Treehugger Robot
73a54f653b Merge "Replace writepid with task_profiles command for cgroup migration" 2021-06-23 21:32:20 +00:00
Suren Baghdasaryan
d7d3010c45 Replace writepid with task_profiles command for cgroup migration
writepid command usage to join a cgroup has been deprecated in favor
of a more flexible approach using task_profiles. This way cgroup path
is not hardcoded and cgroup changes can be easily made. Replace
writepid with task_profiles command to migrate between cgroups.

Bug: 191283136
Test: build and boot
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I9e89fc0f3dc1b4e970cf3a5982ed7f177d2c392c
2021-06-23 18:40:55 +00:00
Paul Crowley
1c33372856 Merge "Remove wait_for_keymaster and all references" am: a236ff87b9 am: f267642932 am: 8b6b626be7
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1736579

Change-Id: I1ea34e82df2893e31de97ba1267aa52a7dda91b0
2021-06-17 19:04:06 +00:00
Paul Crowley
8b6b626be7 Merge "Remove wait_for_keymaster and all references" am: a236ff87b9 am: f267642932
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1736579

Change-Id: If6bbdf4c3ae08f8d372afbd635353b47c131fbdd
2021-06-17 18:58:11 +00:00
Paul Crowley
f267642932 Merge "Remove wait_for_keymaster and all references" am: a236ff87b9
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1736579

Change-Id: I163f07ec1d3f62423d233da7bf225579f9d0894f
2021-06-17 18:40:40 +00:00
Paul Crowley
a236ff87b9 Merge "Remove wait_for_keymaster and all references" 2021-06-17 18:18:28 +00:00
Treehugger Robot
619bfa14fa Merge "No using inside header files" am: 17e1a0919d am: 23aaf5a7a6 am: a1c6ce6f2f
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1285212

Change-Id: Ieaf8c96378dfdf20ce21648c0fb6ae9e39ce4260
2021-06-16 10:41:30 +00:00
Treehugger Robot
a1c6ce6f2f Merge "No using inside header files" am: 17e1a0919d am: 23aaf5a7a6
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1285212

Change-Id: I9299b2f0762c02dae28b4dad8a6ee67fd03ad1a1
2021-06-16 10:31:29 +00:00
Treehugger Robot
23aaf5a7a6 Merge "No using inside header files" am: 17e1a0919d
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1285212

Change-Id: Ifb5136466ac04777988d14e3db63578a66384d29
2021-06-16 10:14:44 +00:00
Treehugger Robot
17e1a0919d Merge "No using inside header files" 2021-06-16 09:56:52 +00:00
Paul Crowley
604abdd0cb Remove wait_for_keymaster and all references
No longer needed now init listens for property changes on a
separate thread.

Bug: 186580823
Test: Cuttlefish boots successfully
Change-Id: I7dd1f85a73df6c2160ef8778703709e90309b9b4
2021-06-15 15:54:51 -07:00
Eric Biggers
ef466e905e Merge "Replace most references to Keymaster with Keystore" am: ec78a94586 am: 087a2952db am: 23638cfcb3
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1737853

Change-Id: Iab08102098f80f2211f9b24e2e9b8b6a384f8ced
2021-06-15 22:34:59 +00:00
Paul Crowley
f4430387d2 No using inside header files
I thought it was OK to use "using" in a header file so long as it was
inside a "namespace" block, but it just imports symbols from one
namespace into another, so things that shouldn't work do.

Test: Treehugger
Change-Id: I4d43d35339636af7e95761cada7120b4db638c01
2021-06-15 15:20:44 -07:00
Eric Biggers
23638cfcb3 Merge "Replace most references to Keymaster with Keystore" am: ec78a94586 am: 087a2952db
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1737853

Change-Id: Ic1b3d004e7d999e934cf47f987899c4ab378c12e
2021-06-15 22:10:10 +00:00
Eric Biggers
087a2952db Merge "Replace most references to Keymaster with Keystore" am: ec78a94586
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1737853

Change-Id: Ic27ef7ebf2817da0a1a302ae77186ce3973368a1
2021-06-15 21:50:06 +00:00
Eric Biggers
ec78a94586 Merge "Replace most references to Keymaster with Keystore" 2021-06-15 21:35:16 +00:00
Eric Biggers
d86a8abec7 Replace most references to Keymaster with Keystore
Now that vold uses Keystore2 rather than the Keymaster HAL directly, and
also the new version of Keymaster is called "KeyMint" instead, replace
most of the references to Keymaster in vold with Keystore.

(I decided not to include the "2" in most places, as it seemed
unnecessarily precise in most places, and it would be something that
might need to keep being updated.  Only Keystore.{cpp,h} really need to
care about the version number.)

I didn't rename many things in cryptfs.cpp, as that file will be going
away soon anyway.  I also left "wait_for_keymaster" and "vdc keymaster
earlyBootEnded" as-is for now, as those are referenced outside vold.

Bug: 183669495
Change-Id: I92cd648fae09f8c9769f7cf34dbf6c6e956be4e8
2021-06-15 12:07:15 -07:00
Eric Biggers
68361c3bdb Merge "cryptfs: log beginning/end of each unmount attempt" am: e33bd41f49 am: d535dc6846 am: 148960c4da
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1735012

Change-Id: I32d1255579ddcdff82871916dfefff1e72fe8afb
2021-06-14 22:42:03 +00:00
Eric Biggers
148960c4da Merge "cryptfs: log beginning/end of each unmount attempt" am: e33bd41f49 am: d535dc6846
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1735012

Change-Id: I6ae1f131ef7b29dc220531dfc619e846c704fb1e
2021-06-14 22:27:49 +00:00
Eric Biggers
d535dc6846 Merge "cryptfs: log beginning/end of each unmount attempt" am: e33bd41f49
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1735012

Change-Id: Id6caea9e59a5b65a594c3545ca8d3e90a0558a7c
2021-06-14 22:15:18 +00:00
Eric Biggers
e33bd41f49 Merge "cryptfs: log beginning/end of each unmount attempt" 2021-06-14 22:00:00 +00:00
Xin Li
673016129a [automerger skipped] Merge "DO NOT MERGE - Merge ab/7272582" am: 12e48a85fb am: 35c828e5ae am: 640c6943a8 -s ours
am skip reason: subject contains skip directive

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

Change-Id: I842ba6c219a4ea07646591c52f92333c2d0265c4
2021-06-14 03:47:46 +00:00
Xin Li
c8678f8ce5 [automerger skipped] DO NOT MERGE - Merge ab/7272582 am: 1c79e144d5 am: 0bd6aa1328 am: a63ab5e7e0 -s ours
am skip reason: subject contains skip directive

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

Change-Id: Ied712d4cca18855f49241ff5125cf05322177d04
2021-06-14 03:47:37 +00:00
Xin Li
640c6943a8 Merge "DO NOT MERGE - Merge ab/7272582" am: 12e48a85fb am: 35c828e5ae
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1735803

Change-Id: Ia5d30ca70429742ba2f59ced83db5f6ba8d8d75b
2021-06-14 03:32:25 +00:00
Xin Li
a63ab5e7e0 DO NOT MERGE - Merge ab/7272582 am: 1c79e144d5 am: 0bd6aa1328
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1735803

Change-Id: I9501c4abe503d3f6e362949e863f8c619bd85087
2021-06-14 03:32:15 +00:00
Xin Li
35c828e5ae Merge "DO NOT MERGE - Merge ab/7272582" am: 12e48a85fb
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1735803

Change-Id: Iad13ce7ee56cf7d85a896f48d4b5af0c5df29220
2021-06-14 03:14:01 +00:00
Xin Li
0bd6aa1328 DO NOT MERGE - Merge ab/7272582 am: 1c79e144d5
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1735803

Change-Id: I6b77a17874d042c6ec322b7a770149e75340a915
2021-06-14 03:13:51 +00:00
Xin Li
12e48a85fb Merge "DO NOT MERGE - Merge ab/7272582" 2021-06-14 03:02:53 +00:00
Eric Biggers
47525e6f78 cryptfs: log beginning/end of each unmount attempt
Add more log messages to make it easier to understand failures in
wait_and_unmount().

Bug: 189250652
Change-Id: I621f54f30bb01cd52c4f9a74dba2d46b4d1a8a9d
2021-06-11 17:56:27 -07:00
Xin Li
1c79e144d5 DO NOT MERGE - Merge ab/7272582
Bug: 190855093
Change-Id: I6739d9fa0fc483ed6128811f0e03c8178fed821a
2021-06-11 17:34:10 -07:00
Treehugger Robot
dec399d125 Merge changes from topic "rename-key-dir" am: 9891ae7479 am: b84d773488 am: ab5fbb523d
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1730556

Change-Id: I16c64a5b0b64960c86a5479a1575fb2353170e9b
2021-06-09 01:13:37 +00:00
Treehugger Robot
ab5fbb523d Merge changes from topic "rename-key-dir" am: 9891ae7479 am: b84d773488
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1730556

Change-Id: Ifd038592b11c23c74bc21320f2d2963be7711a1d
2021-06-09 00:58:28 +00:00
Treehugger Robot
b84d773488 Merge changes from topic "rename-key-dir" am: 9891ae7479
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1730556

Change-Id: I43149e3979d9b7f1548cd91f50024c9d471096f0
2021-06-09 00:37:10 +00:00
Treehugger Robot
9891ae7479 Merge changes from topic "rename-key-dir"
* changes:
  Don't export storeKey(), and update comments
  Always use RenameKeyDir() when moving/renaming key directories
  Make RenameKeyDir() use IsSameFile()
2021-06-09 00:21:43 +00:00
Satya Tangirala
351a4af716 Don't export storeKey(), and update comments
storeKey() is no longer used outside KeyStorage.cpp, so make it a static
function.  Also fix the documentation for storeKey() (e.g. it's no
longer safe to directly move/rename directories created by storeKey() --
one must use RenameKeyDir() instead).

No functional changes.

[ebiggers@ - cleaned up slightly from satyat@'s original change]

Bug: 190398249
Change-Id: I85918359e77bef414dfddfe5ded30fcde6514013
2021-06-08 15:57:31 -07:00
Satya Tangirala
0f890a93e1 Always use RenameKeyDir() when moving/renaming key directories
Make fixate_user_ce_key() use RenameKeyDir() to rename key directories
so that any deferred commits for these directories are also updated
appropriately.

This fixes a potential lost Keymaster key upgrade if a key were to be
re-wrapped while a user data checkpoint is pending.  This isn't a huge
issue as the key will just get upgraded again, but this should be fixed.

[ebiggers@ - cleaned up slightly from satyat@'s original change]

Bug: 190398249
Change-Id: Ic6c5b4468d07ab335368e3d373916145d096af01
2021-06-08 15:57:31 -07:00
Eric Biggers
107d21d484 Make RenameKeyDir() use IsSameFile()
Comparing paths is error-prone (e.g. "/foo/bar" vs "/foo//bar"), so
entries in key_dirs_to_commit are compared using inode and device
number.  However RenameKeyDir() breaks this rule and compares raw paths.

Avoid this quirk by finding the entry in the list to replace before
doing the rename.

This doesn't fix any known problem, as vold is fairly consistent with
its paths in practice; this is just a robustness improvement.

Bug: 190398249
Change-Id: I3ce2c0119cb2012ac9d12849570e56600bc23867
2021-06-08 15:57:31 -07:00
Treehugger Robot
ee68ee6294 Merge "cryptfs: try harder to unmount subdirectory mounts" am: 827dfe6e75 am: bf28ef63eb am: 3ad9d341e1
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1729173

Change-Id: Ifd615cc8cd24107f3095acf65c3c1048d7361179
2021-06-08 20:46:19 +00:00
Eric Biggers
1d1d8ab82b Merge "Remove /data/misc/vold/user_keys/ce/${user_id} when no longer needed" am: 67db7b9786 am: 7ece899507 am: 883908791b
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1721850

Change-Id: I95bab073b3ae841d147c863af158574155adfe98
2021-06-08 20:44:30 +00:00
Treehugger Robot
3ad9d341e1 Merge "cryptfs: try harder to unmount subdirectory mounts" am: 827dfe6e75 am: bf28ef63eb
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1729173

Change-Id: I69e130850e108e9de59cf782e54cdce075376b19
2021-06-08 20:16:37 +00:00
Eric Biggers
883908791b Merge "Remove /data/misc/vold/user_keys/ce/${user_id} when no longer needed" am: 67db7b9786 am: 7ece899507
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1721850

Change-Id: Id39d7e567dc2484b859efb10a4d3b2cd696172ba
2021-06-08 20:15:47 +00:00
Treehugger Robot
bf28ef63eb Merge "cryptfs: try harder to unmount subdirectory mounts" am: 827dfe6e75
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1729173

Change-Id: Ia4e3e045742d5aa15fb25d20c027911a84872195
2021-06-08 19:59:37 +00:00