|
| | FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) |
| | FILE_SECBOOT (PERMITTED) |
| static int | efi_veto_unload (struct efi_veto *veto) |
| | Unload an EFI driver.
|
| static int | efi_veto_disconnect (struct efi_veto *veto) |
| | Disconnect an EFI driver from all handles.
|
| static int | efi_veto_uninstall (struct efi_veto *veto) |
| | Uninstall an EFI driver binding protocol.
|
| static int | efi_veto_close_protocol (struct efi_veto *veto, EFI_HANDLE handle, EFI_GUID *protocol) |
| | Close protocol on handle potentially opened by an EFI driver.
|
| static int | efi_veto_close_handle (struct efi_veto *veto, EFI_HANDLE handle) |
| | Close handle potentially opened by an EFI driver.
|
| static int | efi_veto_close (struct efi_veto *veto) |
| | Close all remaining handles opened by an EFI driver.
|
| static int | efi_veto_destroy (struct efi_veto *veto) |
| | Terminate an EFI driver with extreme prejudice.
|
| static int | efi_veto_driver (struct efi_veto *veto) |
| | Veto an EFI driver.
|
| static int | efi_veto_ip4config (EFI_DRIVER_BINDING_PROTOCOL *binding __unused, EFI_LOADED_IMAGE_PROTOCOL *loaded __unused, const char *manufacturer, const CHAR16 *name) |
| | Veto Ip4ConfigDxe driver on some platforms.
|
| static int | efi_veto_hp_xhci (EFI_DRIVER_BINDING_PROTOCOL *binding __unused, EFI_LOADED_IMAGE_PROTOCOL *loaded __unused, const char *manufacturer, const CHAR16 *name) |
| | Veto HP XhciDxe driver.
|
| static int | efi_veto_vmware_uefipxebc (EFI_DRIVER_BINDING_PROTOCOL *binding __unused, EFI_LOADED_IMAGE_PROTOCOL *loaded __unused, const char *manufacturer, const CHAR16 *name) |
| | Veto VMware UefiPxeBcDxe driver.
|
| static int | efi_veto_dhcp6 (EFI_DRIVER_BINDING_PROTOCOL *binding __unused, EFI_LOADED_IMAGE_PROTOCOL *loaded __unused, const char *manufacturer __unused, const CHAR16 *name) |
| | Veto Dhcp6Dxe driver.
|
| static int | efi_veto_find (EFI_HANDLE driver, const char *manufacturer, struct efi_veto *veto) |
| | Find driver veto, if any.
|
| void | efi_veto (void) |
| | Remove any vetoed drivers.
|
EFI driver vetoes.
Definition in file efi_veto.c.
| int efi_veto_disconnect |
( |
struct efi_veto * | veto | ) |
|
|
static |
Disconnect an EFI driver from all handles.
- Parameters
-
- Return values
-
Definition at line 104 of file efi_veto.c.
104 {
110 unsigned int i;
113
114
116 &
count, &handles ) ) != 0 ) {
118 DBGC ( driver,
"EFIVETO %s could not enumerate handles: %s\n",
120 goto err_list;
121 }
122
123
124 for ( i = 0 ; i <
count ; i++ ) {
127 DBGC ( driver,
"EFIVETO %s could not disconnect",
129 DBGC ( driver,
" %s: %s\n",
131 goto err_disconnect;
132 }
133 }
134
135
137 DBGC2 ( driver,
"EFIVETO %s disconnected all handles\n",
139
140 err_disconnect:
142 err_list:
144}
UINT64 UINTN
Unsigned value of native width.
#define NULL
NULL pointer (VOID *)
@ AllHandles
Retrieve all the handles in the handle database.
int efi_disconnect(EFI_HANDLE device, EFI_HANDLE driver)
Disconnect UEFI driver(s)
static unsigned int count
Number of entries.
EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer
References AllHandles, count, DBGC, DBGC2, efi_veto::driver, EEFI, efi_disconnect(), EFI_HANDLE, efi_handle_name(), efi_systab, EFI_BOOT_SERVICES::FreePool, handle, EFI_BOOT_SERVICES::LocateHandleBuffer, NULL, rc, and strerror().
Referenced by efi_veto_destroy().
| int efi_veto_uninstall |
( |
struct efi_veto * | veto | ) |
|
|
static |
Uninstall an EFI driver binding protocol.
- Parameters
-
- Return values
-
Definition at line 152 of file efi_veto.c.
152 {
158
159
161 &binding ) ) != 0 ) {
162 DBGC ( driver,
"EFIVETO %s could not open driver binding "
166 }
167
168
171 binding,
NULL ) ) != 0 ) {
173 DBGC ( driver,
"EFIVETO %s could not uninstall driver "
174 "binding protocol: %s\n",
177 }
178
179 DBGC2 ( driver,
"EFIVETO %s uninstalled driver binding protocol\n",
181 return 0;
182}
struct _EFI_DRIVER_BINDING_PROTOCOL EFI_DRIVER_BINDING_PROTOCOL
EFI_GUID efi_driver_binding_protocol_guid
Driver binding protocol GUID.
#define efi_open(handle, protocol, interface)
Open protocol for ephemeral use.
EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES UninstallMultipleProtocolInterfaces
References DBGC, DBGC2, efi_veto::driver, EEFI, efi_driver_binding_protocol_guid, EFI_HANDLE, efi_handle_name(), efi_open, efi_systab, NULL, rc, strerror(), and EFI_BOOT_SERVICES::UninstallMultipleProtocolInterfaces.
Referenced by efi_veto_destroy().
Close protocol on handle potentially opened by an EFI driver.
- Parameters
-
| veto | Driver veto |
| handle | Potentially opened handle |
| protocol | Opened protocol |
- Return values
-
Definition at line 192 of file efi_veto.c.
193 {
201 unsigned int i;
204
205
209 DBGC ( driver,
"EFIVETO %s could not retrieve openers",
213 goto err_list;
214 }
215
216
217 for ( i = 0 ; i <
count ; i++ ) {
218 opener = &openers[
count - i - 1 ];
221 continue;
222 }
228 DBGC ( driver,
"EFIVETO %s could not close stray open",
230 DBGC ( driver,
" of %s: %s\n",
232 goto err_close;
233 }
234 }
235
236
238
239 err_close:
241 err_list:
243}
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
uint8_t controller
CD-ROM controller number.
#define DBGC_EFI_OPENER(...)
uint16_t protocol
Protocol ID.
EFI_OPEN_PROTOCOL_INFORMATION OpenProtocolInformation
EFI_CLOSE_PROTOCOL CloseProtocol
EFI Oprn Protocol Information Entry.
EFI_HANDLE ControllerHandle
References EFI_OPEN_PROTOCOL_INFORMATION_ENTRY::AgentHandle, EFI_BOOT_SERVICES::CloseProtocol, controller, EFI_OPEN_PROTOCOL_INFORMATION_ENTRY::ControllerHandle, count, DBGC, DBGC_EFI_OPENER, efi_veto::driver, EEFI, efi_guid_ntoa(), EFI_HANDLE, efi_handle_name(), efi_systab, EFI_BOOT_SERVICES::FreePool, handle, efi_veto::image, EFI_BOOT_SERVICES::OpenProtocolInformation, protocol, rc, and strerror().
Referenced by efi_veto_close_handle().
Close handle potentially opened by an EFI driver.
- Parameters
-
| veto | Driver veto |
| handle | Potentially opened handle |
- Return values
-
Definition at line 252 of file efi_veto.c.
252 {
258 unsigned int i;
261
262
266 DBGC ( driver,
"EFIVETO %s could not retrieve protocols",
268 DBGC ( driver,
" for %s: %s\n",
270 goto err_list;
271 }
272
273
274 for ( i = 0 ; i <
count ; i++ ) {
278 goto err_close;
279 }
280
281
283
284 err_close:
286 err_list:
288}
GUID EFI_GUID
128-bit buffer containing a unique identifier value.
static int efi_veto_close_protocol(struct efi_veto *veto, EFI_HANDLE handle, EFI_GUID *protocol)
Close protocol on handle potentially opened by an EFI driver.
EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle
References count, DBGC, efi_veto::driver, EEFI, EFI_HANDLE, efi_handle_name(), efi_systab, efi_veto_close_protocol(), EFI_BOOT_SERVICES::FreePool, handle, protocol, EFI_BOOT_SERVICES::ProtocolsPerHandle, rc, and strerror().
Referenced by efi_veto_close().
| int efi_veto_close |
( |
struct efi_veto * | veto | ) |
|
|
static |
Close all remaining handles opened by an EFI driver.
- Parameters
-
- Return values
-
Definition at line 296 of file efi_veto.c.
296 {
302 unsigned int i;
305
306
308 &
count, &handles ) ) != 0 ) {
310 DBGC ( driver,
"EFIVETO %s could not enumerate handles: %s\n",
312 goto err_list;
313 }
314
315
316 for ( i = 0 ; i <
count ; i++ ) {
319 goto err_close;
320 }
321
322
324 DBGC2 ( driver,
"EFIVETO %s closed all remaining handles\n",
326
327 err_close:
329 err_list:
331}
static int efi_veto_close_handle(struct efi_veto *veto, EFI_HANDLE handle)
Close handle potentially opened by an EFI driver.
References AllHandles, count, DBGC, DBGC2, efi_veto::driver, EEFI, EFI_HANDLE, efi_handle_name(), efi_systab, efi_veto_close_handle(), EFI_BOOT_SERVICES::FreePool, handle, EFI_BOOT_SERVICES::LocateHandleBuffer, NULL, rc, and strerror().
Referenced by efi_veto_destroy().
| int efi_veto_find |
( |
EFI_HANDLE | driver, |
|
|
const char * | manufacturer, |
|
|
struct efi_veto * | veto ) |
|
static |
Find driver veto, if any.
- Parameters
-
| driver | Driver binding handle |
| manufacturer | Manufacturer name, if present |
- Return values
-
| veto | Driver veto to fill in |
| rc | Return status code |
Definition at line 531 of file efi_veto.c.
532 {
538 unsigned int i;
542
543
544 memset ( veto, 0,
sizeof ( *veto ) );
545
546
548 &binding ) ) != 0 ) {
549 DBGC ( driver,
"EFIVETO %s could not open driver binding "
553 }
555
556
558 &loaded ) ) != 0 ) {
559 DBGC ( driver,
"EFIVETO %s could not open",
561 DBGC ( driver,
" %s loaded image protocol: %s\n",
564 }
565
566
568 &wtf2 ) ) != 0 ) {
569
570 }
571
572
575
576 }
577
578
580 &
name ) == 0 ) ) ) ||
581 (
wtf && ( ( efirc =
wtf->GetDriverName (
wtf,
"eng",
582 &
name ) == 0 ) ) ) ) {
583
584 } else {
585
587 }
588
589
597 DBGC ( driver,
"EFIVETO %s is vetoed (%s)\n",
604 break;
605 }
606 }
607
608 return 0;
609}
struct _EFI_COMPONENT_NAME2_PROTOCOL EFI_COMPONENT_NAME2_PROTOCOL
struct _EFI_COMPONENT_NAME_PROTOCOL EFI_COMPONENT_NAME_PROTOCOL
EFI_GUID efi_loaded_image_protocol_guid
Loaded image protocol GUID.
EFI_GUID efi_component_name2_protocol_guid
Component name 2 protocol GUID.
EFI_GUID efi_component_name_protocol_guid
Component name protocol GUID.
static struct efi_veto_candidate efi_vetoes[]
Driver vetoes.
void * memset(void *dest, int character, size_t len) __nonnull
char wtf[42]
Authenticator response string.
Can be used on any image handle to obtain information about the loaded image.
UINT64 ImageSize
The size in bytes of the loaded image.
VOID * ImageBase
The base address at which the image was loaded.
EFI_COMPONENT_NAME2_GET_DRIVER_NAME GetDriverName
EFI_HANDLE ImageHandle
The image handle of the UEFI driver that produced this instance of the EFI_DRIVER_BINDING_PROTOCOL.
EFI_DRIVER_BINDING_PROTOCOL * binding
Driving binding protocol.
EFI_LOADED_IMAGE_PROTOCOL * loaded
Loaded image protocol.
References DBGC, DBGC2, efi_component_name2_protocol_guid, efi_component_name_protocol_guid, efi_driver_binding_protocol_guid, EFI_HANDLE, efi_handle_name(), efi_loaded_image_protocol_guid, efi_open, efi_vetoes, _EFI_COMPONENT_NAME2_PROTOCOL::GetDriverName, EFI_LOADED_IMAGE_PROTOCOL::ImageBase, _EFI_DRIVER_BINDING_PROTOCOL::ImageHandle, EFI_LOADED_IMAGE_PROTOCOL::ImageSize, manufacturer, memset(), name, NULL, rc, strerror(), efi_veto_candidate::veto, and wtf.
Referenced by efi_veto().
Remove any vetoed drivers.
Definition at line 615 of file efi_veto.c.
615 {
621 unsigned int i;
625
626
633 return;
634 }
635
636
640
641
642 for ( i = 0 ; i <
count ; i++ ) {
645 &veto ) ) != 0 ) {
646 DBGC (
driver,
"EFIVETO %s could not determine "
647 "vetoing: %s\n",
649 continue;
650 }
651 if ( ! veto.driver )
652 continue;
654 DBGC (
driver,
"EFIVETO %s could not veto: %s\n",
656 }
657 }
658
659
661
662
664}
@ ByProtocol
Retrieve the set of handles from the handle database that support a specified protocol.
static int efi_veto_driver(struct efi_veto *veto)
Veto an EFI driver.
static int efi_veto_find(EFI_HANDLE driver, const char *manufacturer, struct efi_veto *veto)
Find driver veto, if any.
static void(* free)(struct refcnt *refcnt))
int fetch_string_setting_copy(struct settings *settings, const struct setting *setting, char **data)
Fetch value of string setting.
References ByProtocol, count, DBGC, efi_veto::driver, EEFI, efi_driver_binding_protocol_guid, EFI_HANDLE, efi_handle_name(), efi_systab, efi_veto_driver(), efi_veto_find(), efi_vetoes, fetch_string_setting_copy(), free, EFI_BOOT_SERVICES::FreePool, EFI_BOOT_SERVICES::LocateHandleBuffer, manufacturer, NULL, rc, and strerror().
Referenced by efi_probe().