Skip to content

Commit 3b68bf2

Browse files
author
Martijn Coenen
committed
Split fsverity_init in two phases.
First load the verified keys, and then only lock the keyring after apexd has run. This is in preperation for on-device signing, which will need to add another key to the fs-verity keyring before it's locked. Note that I've moved loading of the verified keys up a bit; fsverity_init used to load keys from Keymaster, but it currently doesn't, so there's no need to wait for it. Bug: 165630556 Test: boot, cat /proc/keys Change-Id: I077673575ae3dafcf3126d8c544fe7f8d34c0225
1 parent b0db51d commit 3b68bf2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

rootdir/init.rc

+6-3
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,9 @@ on late-fs
585585
# HALs required before storage encryption can get unlocked (FBE/FDE)
586586
class_start early_hal
587587

588+
# Load trusted keys from dm-verity protected partitions
589+
exec -- /system/bin/fsverity_init --load-verified-keys
590+
588591
on post-fs-data
589592
mark_post_data
590593

@@ -826,6 +829,9 @@ on post-fs-data
826829
wait_for_prop apexd.status activated
827830
perform_apex_config
828831

832+
# Lock the fs-verity keyring, so no more keys can be added
833+
exec -- /system/bin/fsverity_init --lock
834+
829835
# After apexes are mounted, tell keymaster early boot has ended, so it will
830836
# stop allowing use of early-boot keys
831837
exec - system system -- /system/bin/vdc keymaster early-boot-ended
@@ -1007,9 +1013,6 @@ on boot
10071013

10081014
class_start core
10091015

1010-
# Requires keystore (currently a core service) to be ready first.
1011-
exec -- /system/bin/fsverity_init
1012-
10131016
on nonencrypted
10141017
class_start main
10151018
class_start late_start

0 commit comments

Comments
 (0)