virtmgr: don't check label for vendor initiated VMs
Checking for a prefix on the label is a bad practice and doesn't enforce
the relevant constraint (that the file isn't writable), so just skip the
check altogether for now.
Note that we have a separate check that verifes the files must come from
the vendor partition and that isn't changing in this commit.
Bug: 397499254
Bug: 393087663
Test: m
Change-Id: Iaa3201a78effb63184e80c51bf4c2550298ea299
diff --git a/android/virtmgr/src/aidl.rs b/android/virtmgr/src/aidl.rs
index eefaa65..28f36fd 100644
--- a/android/virtmgr/src/aidl.rs
+++ b/android/virtmgr/src/aidl.rs
@@ -1592,9 +1592,8 @@
| "virtualizationservice_data_file" // files created by VS / VirtMgr
| "vendor_microdroid_file" // immutable dm-verity protected partition (/vendor/etc/avf/microdroid/.*)
=> Ok(()),
- // It is difficult to require specific label types for vendor initiated VM's files, so we
- // allow anything with a vendor prefix.
- t if calling_partition == CallingPartition::Vendor && t.starts_with("vendor_") => Ok(()),
+ // It is difficult to require specific label types for vendor initiated VM's files.
+ _ if calling_partition == CallingPartition::Vendor => Ok(()),
_ => bail!("Label {} is not allowed", context),
}
}