efi_loader: initialise partition_signature memory
PATCH 1/1 efi_loader: initialise partition_signature memory
Zero partition_signature in the efi_device_path_hard_drive_path structure when signature_type is zero.
This is required so that efi_dp_match() will work as expected when doing memcmp() comparisons.
Corrects a problem where the loaded image protocol would not return a device path with MEDIA_DEVICE causing the OpenBSD bootloader to fail on rpi_3 and other targets.
--- lib/efi_loader/efi_device_path.c | 3 +++ 1 file changed, 3 insertions(+)
lib/efi_loader/efi_device_path.c +3 -0
@@ -431,6 +431,9 @@ static void *dp_part_fill(void *buf, struct blk_desc *desc, int part)if (hddp->signature_type !=0 )memcpy (hddp->partition_signature, &desc->guid_sig,sizeof (hddp->partition_signature)); +else +memset (hddp->partition_signature,0 , +sizeof (hddp->partition_signature)); buf = &hddp[1 ]; }
Signature · 1 line
2.15.0
PATCH 1/1 efi_loader: initialise partition_signature memory
Quoted 11 lines · Jonathan Gray
Zero
partition_signaturein theefi_device_path_hard_drive_pathstructure whensignature_typeis zero.This is required so that
efi_dp_match()will work as expected when doingmemcmp()comparisons.Corrects a problem where the loaded image protocol would not return a device path with
MEDIA_DEVICEcausing the OpenBSD bootloader to fail onrpi_3and other targets.Signed-off-by Jonathan Gray <[email protected]>
Quoted 21 lines
--- lib/efi_loader/efi_device_path.c | 3 +++ 1 file changed, 3 insertions(+)lib/efi_loader/efi_device_path.c +3
-1@@ -431,6 +431,9 @@ static void *dp_part_fill(void *buf, struct blk_desc *desc, int part)if (hddp->signature_type !=0 )memcpy (hddp->partition_signature, &desc->guid_sig,sizeof (hddp->partition_signature)); +else +memset (hddp->partition_signature,0 , +sizeof (hddp->partition_signature)); buf = &hddp[1 ]; } --2.15.0
PATCH 1/1 efi_loader: initialise partition_signature memory
Quoted 7 lines · Rob Clark
Quoted 6 lines · Jonathan Gray
Zero
partition_signaturein theefi_device_path_hard_drive_pathstructure whensignature_typeis zero.This is required so that
efi_dp_match()will work as expected when doingmemcmp()comparisons.
Quoted 7 lines
Quoted 5 lines
Corrects a problem where the loaded image protocol would not return a device path with
MEDIA_DEVICEcausing the OpenBSD bootloader to fail onrpi_3and other targets.Signed-off-by Jonathan Gray <[email protected]>Reviewed-by Rob Clark <[email protected]>
Expanded v2 version of this is here:
https://patchwork.ozlabs.org/patch/840248/
Quoted 22 lines
Quoted 22 lines
--- lib/efi_loader/efi_device_path.c | 3 +++ 1 file changed, 3 insertions(+)lib/efi_loader/efi_device_path.c +3
-1@@ -431,6 +431,9 @@ static void *dp_part_fill(void *buf, struct blk_desc *desc, int part)if (hddp->signature_type !=0 )memcpy (hddp->partition_signature, &desc->guid_sig,sizeof (hddp->partition_signature)); +else +memset (hddp->partition_signature,0 , +sizeof (hddp->partition_signature)); buf = &hddp[1 ]; } --2.15.0