132 static CHAR16 sbatlevel[] = L
"SbatLevel";
135 return ( (
memcmp (
name, sbatlevel,
sizeof ( sbatlevel ) ) == 0 ) &&
136 (
memcmp (
guid, shimlock,
sizeof ( *shimlock ) ) == 0 ) );
154 NULL, &
u.interface ) ) == 0 ) {
155 u.lock->Verify ( empty,
sizeof ( empty ) );
156 DBGC ( &efi_shim,
"SHIM unlocked via %p\n",
u.lock );
180 DBGC ( &efi_shim,
"SHIM detected write to %ls:\n",
name );
210 DBGC ( &efi_shim,
"SHIM allowing read from %ls:\n",
213 DBGC ( &efi_shim,
"SHIM allowing one read from %ls:\n",
217 DBGC ( &efi_shim,
"SHIM patching read from %ls:\n",
250 DBGC ( &efi_shim,
"SHIM uninstalled SetVariable() wrapper\n" );
252 DBGC ( &efi_shim,
"SHIM could not uninstall SetVariable() " 257 DBGC ( &efi_shim,
"SHIM uninstalled GetVariable() wrapper\n" );
259 DBGC ( &efi_shim,
"SHIM could not uninstall GetVariable() " 289 DBGC ( &efi_shim,
"SHIM could not open PXE base code: %s\n",
295 if ( ( efirc =
u.pxe->Stop (
u.pxe ) ) != 0 ) {
297 DBGC ( &efi_shim,
"SHIM could not stop PXE base code: %s\n",
304 DBGC ( &efi_shim,
"SHIM stopped PXE base code\n" );
321 wchar_t *shimcmdline;
333 DBGC ( &efi_shim,
"SHIM could not construct command line: " 378 DBGC ( &efi_shim,
"SHIM installed wrappers\n" );
395 DBGC ( &efi_shim,
"SHIM uninstalled wrappers\n" );
int efi_shim_allow_sbat
Allow SBAT variable access.
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
EFI_STATUS(EFIAPI * EFI_GET_MEMORY_MAP)(IN OUT UINTN *MemoryMapSize, OUT EFI_MEMORY_DESCRIPTOR *MemoryMap, OUT UINTN *MapKey, OUT UINTN *DescriptorSize, OUT UINT32 *DescriptorVersion)
Returns the current memory map.
struct arbelprm_rc_send_wqe rc
static void efi_shim_unlock(void)
Unlock UEFI shim.
#define EEFI(efirc)
Convert an EFI status code to an iPXE status code.
EFI_LOCATE_PROTOCOL LocateProtocol
Definition of an EFI memory descriptor.
128 bit buffer containing a unique identifier value.
struct image_tag efi_shim __image_tag
UEFI shim image.
int efi_shim_install(struct image *shim, EFI_HANDLE handle, wchar_t **cmdline)
Install UEFI shim special handling.
static EFI_SET_VARIABLE efi_shim_orig_set_variable
Original SetVariable() function.
EFI_GUID efi_pxe_base_code_protocol_guid
PXE base code protocol GUID.
EFI PXE Base Code Protocol definitions, which is used to access PXE-compatible devices for network ac...
EFI_CLOSE_PROTOCOL CloseProtocol
static EFI_GET_MEMORY_MAP efi_shim_orig_get_memory_map
Original GetMemoryMap() function.
static EFIAPI EFI_STATUS efi_shim_get_memory_map(UINTN *len, EFI_MEMORY_DESCRIPTOR *map, UINTN *key, UINTN *desclen, UINT32 *descver)
Wrap GetMemoryMap()
int efi_shim_require_loader
Require use of a third party loader binary.
UEFI shim special handling.
static int efi_shim_cmdline(struct image *shim, wchar_t **cmdline)
Update command line.
int efi_shim_allow_pxe
Allow use of PXE base code protocol.
pseudo_bit_t value[0x00020]
EFI_SET_VARIABLE SetVariable
EFI_GET_VARIABLE GetVariable
uint32_t attrs
Extended attributes (optional)
#define EFI_OPEN_PROTOCOL_GET_PROTOCOL
EFI Runtime Services Table.
char * strerror(int errno)
Retrieve string representation of error number.
static void(* free)(struct refcnt *refcnt))
static int efi_shim_is_sbatlevel(const CHAR16 *name, const EFI_GUID *guid)
Check if variable is SbatLevel.
EFI_HANDLE efi_image_handle
Image handle passed to entry point.
UINT64 UINTN
Unsigned value of native width.
static __always_inline int struct dma_mapping * map
#define VOID
Undeclared type.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
EFI "shim lock" protocol.
EFI_GET_MEMORY_MAP GetMemoryMap
static EFI_GET_VARIABLE efi_shim_orig_get_variable
Original GetVariable() function.
EFI_RUNTIME_SERVICES * RuntimeServices
A pointer to the EFI Runtime Services Table.
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
static EFI_STATUS EFIAPI efi_shim_get_variable(CHAR16 *name, EFI_GUID *guid, UINT32 *attrs, UINTN *len, VOID *data)
Wrap GetVariable()
void efi_shim_uninstall(void)
Uninstall UEFI shim special handling.
uint8_t data[48]
Additional event data.
EFI_GUID efi_shim_lock_protocol_guid
Shim lock protocol GUID.
EFI_SYSTEM_TABLE * efi_systab
EFI_OPEN_PROTOCOL OpenProtocol
The EFI_PXE_BASE_CODE_PROTOCOL is used to control PXE-compatible devices.
int efi_asprintf(wchar_t **wstrp, const char *fmt,...)
Write a formatted string to newly allocated memory.
EFI_STATUS(EFIAPI * EFI_GET_VARIABLE)(IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, OUT UINT32 *Attributes OPTIONAL, IN OUT UINTN *DataSize, OUT VOID *Data OPTIONAL)
Returns the value of a variable.
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
int shim(struct image *image, int require_loader, int allow_pxe, int allow_sbat)
Set shim image.
#define NULL
NULL pointer (VOID *)
static EFI_STATUS EFIAPI efi_shim_set_variable(CHAR16 *name, EFI_GUID *guid, UINT32 attrs, UINTN len, VOID *data)
Wrap SetVariable()
static int efi_shim_sbatlevel_verify
Verify read from SbatLevel variable.
EFI_STATUS(EFIAPI * EFI_SET_VARIABLE)(IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN UINT32 Attributes, IN UINTN DataSize, IN VOID *Data)
Sets the value of a variable.
static int efi_shim_inhibit_pxe(EFI_HANDLE handle)
Inhibit use of PXE base code.