Skip to content

Commit 4bec240

Browse files
committed
boot: measure config first, only then parse
Fixes: #30026
1 parent a3d3bf5 commit 4bec240

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/boot/efi/boot.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1566,7 +1566,7 @@ static void config_load_defaults(Config *config, EFI_FILE *root_dir) {
15661566

15671567
err = file_read(root_dir, u"\\loader\\loader.conf", 0, 0, &content, &content_size);
15681568
if (err == EFI_SUCCESS) {
1569-
config_defaults_load_from_file(config, content);
1569+
/* First, measure. */
15701570
err = tpm_log_tagged_event(
15711571
TPM2_PCR_BOOT_LOADER_CONFIG,
15721572
POINTER_TO_PHYSICAL_ADDRESS(content),
@@ -1576,6 +1576,9 @@ static void config_load_defaults(Config *config, EFI_FILE *root_dir) {
15761576
/* ret_measured= */ NULL);
15771577
if (err != EFI_SUCCESS)
15781578
log_error_status(err, "Error measuring loader.conf into TPM: %m");
1579+
1580+
/* Then: parse */
1581+
config_defaults_load_from_file(config, content);
15791582
}
15801583

15811584
err = efivar_get_timeout(u"LoaderConfigTimeout", &config->timeout_sec_efivar);

0 commit comments

Comments
 (0)