NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/58075: efi_bootdp memory corrupted by OpenProtocol on some machines



The attached patch on efiboot as of HEAD, without backing out efinet.c
rev. 1.9, seems to make the bootloader work reliably on the Synquacer.
Thoughts?
From 300bea0f4e29cd53c55edb16e49c03d1727cd0b8 Mon Sep 17 00:00:00 2001
From: Taylor R Campbell <riastradh%NetBSD.org@localhost>
Date: Sun, 24 Mar 2024 19:18:11 +0000
Subject: [PATCH] efiboot: Duplicate efi_bootdp before we clobber it in
 efi_net_probe.

Patch from jakllsch@.  Makes Socionext Synquacer boot considerably
more reliably.

PR kern/58075
---
 sys/stand/efiboot/efiboot.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/stand/efiboot/efiboot.c b/sys/stand/efiboot/efiboot.c
index 03af54ae8627..8c444357beee 100644
--- a/sys/stand/efiboot/efiboot.c
+++ b/sys/stand/efiboot/efiboot.c
@@ -86,6 +86,8 @@ efi_main(EFI_HANDLE imageHandle, EFI_SYSTEM_TABLE *systemTable)
 	status = uefi_call_wrapper(BS->HandleProtocol, 3, efi_li->DeviceHandle, &DevicePathProtocol, (void **)&efi_bootdp);
 	if (EFI_ERROR(status))
 		efi_bootdp = NULL;
+	else
+		efi_bootdp = DuplicateDevicePath(efi_bootdp);
 
 #ifdef EFIBOOT_DEBUG
 	Print(L"Loaded image      : 0x%" PRIxEFIPTR "\n", efi_li);


Home | Main Index | Thread Index | Old Index