efi_loader: correct headersize EFI tables
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Thu, 28 Jun 2018 10:45:29 +0000 (12:45 +0200)
committerAlexander Graf <agraf@suse.de>
Wed, 25 Jul 2018 12:59:44 +0000 (14:59 +0200)
The headersize field has to be set to the size of the whole table
including the header.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
lib/efi_loader/efi_boottime.c
lib/efi_loader/efi_runtime.c

index 9a0c3235cf22efe53d96b4ea10b6d0b7cfa005c7..f6df6df7172c24c9aaa23c352d94cf1bdd6f27f1 100644 (file)
@@ -3060,7 +3060,7 @@ static const struct efi_boot_services efi_boot_services = {
        .hdr = {
                .signature = EFI_BOOT_SERVICES_SIGNATURE,
                .revision = EFI_SPECIFICATION_VERSION,
-               .headersize = sizeof(struct efi_table_hdr),
+               .headersize = sizeof(struct efi_boot_services),
        },
        .raise_tpl = efi_raise_tpl,
        .restore_tpl = efi_restore_tpl,
@@ -3116,7 +3116,7 @@ struct efi_system_table __efi_runtime_data systab = {
        .hdr = {
                .signature = EFI_SYSTEM_TABLE_SIGNATURE,
                .revision = EFI_SPECIFICATION_VERSION,
-               .headersize = sizeof(struct efi_table_hdr),
+               .headersize = sizeof(struct efi_system_table),
        },
        .fw_vendor = (long)firmware_vendor,
        .con_in = (void *)&efi_con_in,
index cfa60b8ff74ddf19d26e7373d518085ca5f678a7..1acb06a206bc8436a57a7dcb2c7b0aecb1dc5c6c 100644 (file)
@@ -460,7 +460,7 @@ struct efi_runtime_services __efi_runtime_data efi_runtime_services = {
        .hdr = {
                .signature = EFI_RUNTIME_SERVICES_SIGNATURE,
                .revision = EFI_SPECIFICATION_VERSION,
-               .headersize = sizeof(struct efi_table_hdr),
+               .headersize = sizeof(struct efi_runtime_services),
        },
        .get_time = &efi_get_time_boottime,
        .set_time = (void *)&efi_device_error,