]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
boot: check that `ret_version` is valid in tpm_log_tagged_event
authorMichael Vogt <michael@amutable.com>
Fri, 13 Mar 2026 10:33:25 +0000 (11:33 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 13 Mar 2026 11:26:23 +0000 (12:26 +0100)
In a project I'm working on I recently observed a boot failure
with the most recent version of systemd. It seems it is triggered
by bb19b61049 which fixed a bug that now leads to the function
being excuted differently. The code is missing a check if
`*ret_version` is actually valid in the `ret_measured = true`
case.

src/boot/measure.c

index 3c51998d1b298a97220df76ad3b7bc28da7f3815..cf3d4254b86cbe596e95bd3f2dfc0edc7bd2c647 100644 (file)
@@ -312,7 +312,8 @@ EFI_STATUS tpm_log_tagged_event(
         if (err != EFI_SUCCESS)
                 return err;
 
-        *ret_measured = true;
+        if (ret_measured)
+                *ret_measured = true;
         return EFI_SUCCESS;
 }