efi_loader: correct headersize EFI tables

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>
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 9a0c323..f6df6df 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -3060,7 +3060,7 @@
 	.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 @@
 	.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,
diff --git a/lib/efi_loader/efi_runtime.c b/lib/efi_loader/efi_runtime.c
index cfa60b8..1acb06a 100644
--- a/lib/efi_loader/efi_runtime.c
+++ b/lib/efi_loader/efi_runtime.c
@@ -460,7 +460,7 @@
 	.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,