Microdroid: Skip instance.img checks
Microdroid no more needs Instance Image partition if Secretkeeper is
enabled.
The use of instance.img is to store package data at first boot of the
instance & MM ensures that it did not change on further boot. With
Secretkeeper based rollback protection, the auth_hash & version of each
of these packages are part of DICE Policy & Sk ensures that the secrets
are not released if the version downgrades or auth_hash changes.
Therefore, there is no longer any need for this data to be in
instance.img
Note: Since Secretkeeper is an optional HAL in Android V, we still need
to support the instance.img for cases when Secretkeeper implementation
is not available.
Security: This opens up the Sealing CDIs of a pVM to Payload with lower
security version. But all CDIs will be reset once pvmfw starts including
Instance-Id in the hidden inputs, so this is a safe change.
Trunk Flagging: If LLPVM flag is disabled, is_sk_supported() returns
false & legacy route of verification with instance img is executed.
Bug: 291306122
Test: Get an instance.img of a pVM (started with vm run-microdroid)
Test: hexdump -C img | grep for Microdroid partition UUID. It should be missing
Change-Id: Iad97f2c81f759a1c13eac6d1302dee43be534e11
diff --git a/microdroid_manager/src/vm_secret.rs b/microdroid_manager/src/vm_secret.rs
index 4ead211..91f5abd 100644
--- a/microdroid_manager/src/vm_secret.rs
+++ b/microdroid_manager/src/vm_secret.rs
@@ -268,9 +268,9 @@
anyhow!("{:?}", err)
}
-// Get the secretkeeper connection if supported. Host can be consulted whether the device supports
-// secretkeeper but that should be used with caution for protected VM.
-fn is_sk_supported(
+/// Get the secretkeeper connection if supported. Host can be consulted whether the device supports
+/// secretkeeper but that should be used with caution for protected VM.
+pub fn is_sk_supported(
host: &Strong<dyn IVirtualMachineService>,
) -> Result<Option<Strong<dyn ISecretkeeper>>> {
let sk = if cfg!(llpvm_changes) {