Merge tag 'efi-next-for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi
[platform/kernel/linux-rpi.git] / drivers / firmware / efi / libstub / x86-stub.c
index 8cb7ff5..b9ce639 100644 (file)
@@ -220,7 +220,6 @@ adjust_memory_range_protection(unsigned long start, unsigned long size)
        unsigned long end, next;
        unsigned long rounded_start, rounded_end;
        unsigned long unprotect_start, unprotect_size;
-       int has_system_memory = 0;
 
        if (efi_dxe_table == NULL)
                return;
@@ -517,6 +516,13 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle,
        hdr->ramdisk_image = 0;
        hdr->ramdisk_size = 0;
 
+       /*
+        * Disregard any setup data that was provided by the bootloader:
+        * setup_data could be pointing anywhere, and we have no way of
+        * authenticating or validating the payload.
+        */
+       hdr->setup_data = 0;
+
        efi_stub_entry(handle, sys_table_arg, boot_params);
        /* not reached */