Skip to contentSkip to conversation

arm64: set correct length of device path end entry

PATCH In review Leif Lindholm 2 participants 3 messages Jan 7, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: set correct length of device path end entry

The length of the Device Path End entry in the grub_linux_boot() funtcion is incorrectly set to 0. This triggers an assert failure in debug builds of Tianocore.

The correct length is 4 bytes (1 byte type, 1 byte subtype, 2 bytes length).

grub-core/loader/arm64/linux.c +1 -1
index 9d15aad..7c9bc2b 100644
@@ -268,7 +268,7 @@ grub_linux_boot (void)
 
   mempath[1].header.type = GRUB_EFI_END_DEVICE_PATH_TYPE;
   mempath[1].header.subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE;
-  mempath[1].header.length = 0;
+  mempath[1].header.length = 4;
 
   b = grub_efi_system_table->boot_services;
   status = b->load_image (0, grub_efi_image_handle,
#1 lore raw

Go ahead.

Quoted 29 lines · Leif Lindholm

The length of the Device Path End entry in the grub_linux_boot() funtcion is incorrectly set to 0. This triggers an assert failure in debug builds of Tianocore.

The correct length is 4 bytes (1 byte type, 1 byte subtype, 2 bytes length).

grub-core/loader/arm64/linux.c +1 -1
index 9d15aad..7c9bc2b 100644
@@ -268,7 +268,7 @@ grub_linux_boot (void)
 
   mempath[1].header.type = GRUB_EFI_END_DEVICE_PATH_TYPE;
   mempath[1].header.subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE;
-  mempath[1].header.length = 0;
+  mempath[1].header.length = 4;
 
   b = grub_efi_system_table->boot_services;
   status = b->load_image (0, grub_efi_image_handle,

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#2 lore raw
In reply to Leif Lindholm
Quoted 14 lines · Leif Lindholm

The length of the Device Path End entry in the grub_linux_boot() funtcion is incorrectly set to 0. This triggers an assert failure in debug builds of Tianocore.

The correct length is 4 bytes (1 byte type, 1 byte subtype, 2 bytes length).

grub-core/loader/arm64/linux.c +0 -0
index 9d15aad..7c9bc2b 100644

grub-core/loader/arm64/linux.c grub_linux_boot (void) · line 272

Quoted 6 lines
grub-core/loader/arm64/linux.c +1 -1
@@ -268,7 +268,7 @@ grub_linux_boot (void)
 
   mempath[1].header.type = GRUB_EFI_END_DEVICE_PATH_TYPE;
   mempath[1].header.subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE;
-  mempath[1].header.length = 0;
+  mempath[1].header.length = 4;
 

Could you use sizeof ?

Quoted 9 lines
grub-core/loader/arm64/linux.c +0 -0
   b = grub_efi_system_table->boot_services;
   status = b->load_image (0, grub_efi_image_handle,

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel