[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <158063637918.411.14525312464973256998.tip-bot2@tip-bot2>
Date: Sun, 02 Feb 2020 09:39:39 -0000
From: "tip-bot2 for Ard Biesheuvel" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: jrg.otte@...il.com, Dan Williams <dan.j.williams@...el.com>,
Ard Biesheuvel <ardb@...nel.org>,
Ingo Molnar <mingo@...nel.org>, linux-efi@...r.kernel.org,
torvalds@...ux-foundation.org, x86 <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: [tip: efi/urgent] efi/x86: Fix boot regression on systems with
invalid memmap entries
The following commit has been merged into the efi/urgent branch of tip:
Commit-ID: 59365cadfbcd299b8cdbe0c165faf15767c5f166
Gitweb: https://git.kernel.org/tip/59365cadfbcd299b8cdbe0c165faf15767c5f166
Author: Ard Biesheuvel <ardb@...nel.org>
AuthorDate: Sun, 02 Feb 2020 00:33:04 +01:00
Committer: Ingo Molnar <mingo@...nel.org>
CommitterDate: Sun, 02 Feb 2020 10:25:43 +01:00
efi/x86: Fix boot regression on systems with invalid memmap entries
In efi_clean_memmap(), we do a pass over the EFI memory map to remove
bogus entries that may be returned on certain systems.
This recent commit:
1db91035d01aa8bf ("efi: Add tracking for dynamically allocated memmaps")
refactored this code to pass the input to efi_memmap_install() via a
temporary struct on the stack, which is populated using an initializer
which inadvertently defines the value of its size field in terms of its
desc_size field, which value cannot be relied upon yet in the initializer
itself.
Fix this by using efi.memmap.desc_size instead, which is where we get
the value for desc_size from in the first place.
Reported-by: Jörg Otte <jrg.otte@...il.com>
Tested-by: Jörg Otte <jrg.otte@...il.com>
Tested-by: Dan Williams <dan.j.williams@...el.com>
Signed-off-by: Ard Biesheuvel <ardb@...nel.org>
Signed-off-by: Ingo Molnar <mingo@...nel.org>
Cc: linux-efi@...r.kernel.org
Cc: jrg.otte@...il.com
Cc: torvalds@...ux-foundation.org
Cc: mingo@...nel.org
Link: https://lore.kernel.org/r/20200201233304.18322-1-ardb@kernel.org
---
arch/x86/platform/efi/efi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index 59f7f6d..ae923ee 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -308,7 +308,7 @@ static void __init efi_clean_memmap(void)
.phys_map = efi.memmap.phys_map,
.desc_version = efi.memmap.desc_version,
.desc_size = efi.memmap.desc_size,
- .size = data.desc_size * (efi.memmap.nr_map - n_removal),
+ .size = efi.memmap.desc_size * (efi.memmap.nr_map - n_removal),
.flags = 0,
};
Powered by blists - more mailing lists