aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2023-06-23 16:12:01 +0100
committerMichael Brown <mcb30@ipxe.org>2023-06-23 16:51:10 +0100
commitf8a0d1c0b8cfd7b04bdc9a006c52434661afd06a (patch)
tree4ab0b75980557a54ed831735a265862b8b1b94f9
parentf0b1025503205515d5b105c37774596623481242 (diff)
downloadipxe-f8a0d1c0b8cfd7b04bdc9a006c52434661afd06a.zip
ipxe-f8a0d1c0b8cfd7b04bdc9a006c52434661afd06a.tar.gz
ipxe-f8a0d1c0b8cfd7b04bdc9a006c52434661afd06a.tar.bz2
[efi] Check for protocols opened by vetoed driver and image handles
The UEFI specification states that the AgentHandle may be either the driving binding protocol handle or the image handle. Check for both handles when searching for stale handles to be forcibly closed on behalf of a vetoed driver. Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r--src/interface/efi/efi_veto.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/interface/efi/efi_veto.c b/src/interface/efi/efi_veto.c
index 3e0806e..bc19a00 100644
--- a/src/interface/efi/efi_veto.c
+++ b/src/interface/efi/efi_veto.c
@@ -205,6 +205,7 @@ static int efi_veto_close_protocol ( struct efi_veto *veto, EFI_HANDLE handle,
EFI_GUID *protocol ) {
EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
EFI_HANDLE driver = veto->driver;
+ EFI_HANDLE image = veto->image;
EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *openers;
EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *opener;
EFI_HANDLE controller;
@@ -227,8 +228,10 @@ static int efi_veto_close_protocol ( struct efi_veto *veto, EFI_HANDLE handle,
/* Close anything opened by this driver */
for ( i = 0 ; i < count ; i++ ) {
opener = &openers[i];
- if ( opener->AgentHandle != driver )
+ if ( ( opener->AgentHandle != driver ) &&
+ ( opener->AgentHandle != image ) ) {
continue;
+ }
controller = opener->ControllerHandle;
DBGC_EFI_OPENER ( driver, handle, protocol, opener );
if ( ( efirc = bs->CloseProtocol ( handle, protocol, driver,