-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tenant registration ends with Invalid Quote with TPM provided by QEMU #821
Comments
FYI @sergio-correia |
@kkaarreell can you also post your IMA log (/sys/kernel/security/ima/ascii_runtime_measurements), your generated policy and the output of tpm2_pcrread ? |
Hi @THS-on , I have uploaded logs in an archive to |
Thanks, @kkaarreell, I was just uploading them as well :) |
@sergio-correia can you try to apply the following patch: diff --git a/keylime/ima_ast.py b/keylime/ima_ast.py
index d9d30d2..e72f044 100644
--- a/keylime/ima_ast.py
+++ b/keylime/ima_ast.py
@@ -348,6 +348,7 @@ class Entry:
# https://elixir.bootlin.com/linux/v5.12.12/source/security/integrity/ima/ima_main.c#L101
if self.ima_template_hash == get_START_HASH(ima_hash_alg):
self.ima_template_hash = get_FF_HASH(ima_hash_alg)
+ self.pcr_template_hash = get_FF_HASH(pcr_hash_alg)
def invalid(self):
failure = Failure(Component.IMA, ["validation"]) |
My test passed with this change, @THS-on, thanks! |
Nice. Can you check if your tested IMA log contains entries like this (the hash is only zeros):
If yes this I'll make this a PR. |
Yeah, I got many entries like these:
|
Is your an issue a feature request? If so, please raise it as an enhancement
Environment
Description
System is a virtual system with TPM emulated by QEMU. IMA is configured in kernel (I am not using keylime IMA emulator).
When registering a tenant it ends up in "operational_state": "Invalid Quote"
and verifier log contains:
keylime.ima - ERROR - IMA measurement list does not match TPM PCR 0cf7680bac137381a86c8d467f7d92331
9d680d6ae5a63e6a493cbd2ef1efa4b
Expected behavior vs. actual behavior
system should be properly registered having state Get Quote.
Steps to reproduce problem
Adding brief test log below
Relevant logs
kernel 5.14.0-39.el9.x86_64
I am not facing this issue when using keylime emulator instead of QEMU TPM
With git bisect we have identified the following commit as the first one introducing the issue.
80990a7 ("algorithms: extend Hash class to simplify computing hash values")
however with this commit the behavior is not exactly as described (there is a traceback due to missing codecs module and even after
fixing the import there are other issues.) With the subsequent commit applied (517a7e8) the behavior matches the reported one.
The text was updated successfully, but these errors were encountered: