Reboot to bootloader if sending module info to KeyMint fails
* Panic in check_send_module_info if sending module info to KeyMint fails.
* Make Keystore a critical service, in order to reboot to bootloader if
Keystore crashes more than 4 times before sys.boot_completed = true.
* On Keystore start, check if we should send KeyMint module info, and if
so, send the info. (The check here is whether keystore.module_hash.sent
!= true.)
Bug: 400439023
Test: (1) for the successful case, ran Keystore CTS tests; (2) for
the unsuccessful case, where we reach the panic in send_module_info,
confirmed that the phone ended up in fastboot.
Flag: android.security.keystore2.attest_modules
Change-Id: I702828fc3462f5e90ae09c4f654d90c85f28195a
diff --git a/keystore2/keystore2.rc b/keystore2/keystore2.rc
index d7d6951..e669b18 100644
--- a/keystore2/keystore2.rc
+++ b/keystore2/keystore2.rc
@@ -13,3 +13,5 @@
task_profiles ProcessCapacityHigh
# The default memlock limit of 65536 bytes is too low for keystore.
rlimit memlock unlimited unlimited
+ # Reboot to bootloader if Keystore crashes more than 4 times before `sys.boot_completed`.
+ critical window=0