efi_loader: efi_current_var after SetVirtualAddressMap
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Wed, 22 Jul 2020 04:29:38 +0000 (06:29 +0200)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Wed, 22 Jul 2020 10:32:41 +0000 (12:32 +0200)
Variable efi_current_var is a pointer to a physical memory address that
becomes invalid after SetVirtualAddressMap(). Instead of converting it via
ConvertPointer() simply set it to NULL.

Fixes: b02a707152dc ("efi_loader: enable UEFI variables at runtime")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
lib/efi_loader/efi_var_mem.c

index 7a2dba7dc2632746c1e2e4bd7ea32ac6caf10eca..856e5e1d56faa9d96241ba3588241de14ebd75f1 100644 (file)
@@ -231,6 +231,7 @@ static void EFIAPI __efi_runtime
 efi_var_mem_notify_virtual_address_map(struct efi_event *event, void *context)
 {
        efi_convert_pointer(0, (void **)&efi_var_buf);
+       efi_current_var = NULL;
 }
 
 efi_status_t efi_var_mem_init(void)