lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 11 Nov 2013 19:15:57 -0700
From:	Jerry Hoemann <jerry.hoemann@...com>
To:	rob@...dley.net, tglx@...utronix.de, mingo@...hat.com,
	hpa@...or.com, x86@...nel.org, matt.fleming@...el.com,
	yinghai@...nel.org, penberg@...nel.org, akpm@...ux-foundation.org,
	linux-doc@...r.kernel.org, linux-efi@...r.kernel.org,
	vgoyal@...hat.com
Cc:	linux-kernel@...r.kernel.org, jerry.hoemann@...com
Subject: [PATCH 2/3] x86: avoid efi_reserve_boot_services

Some platform have firmware that violate UEFI spec and access boot service
code or data segments after the system has called Exit Boot Services.

The call to efi_reserve_boot_services is a work around to avoid using
boot service memory until after the kernel has done Set Virtual Map.

However, this reservation fragments memory which can cause
large allocations early in boot (e.g. crash kernel) to fail.

Avoid calling efi_reserve_boot_services if the memmap
is "correct."

Signed-off-by: Jerry Hoemann <jerry.hoemann@...com>
---
 arch/x86/kernel/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index f0de629..1186ff9 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -1074,7 +1074,7 @@ void __init setup_arch(char **cmdline_p)
 	 * The EFI specification says that boot service code won't be called
 	 * after ExitBootServices(). This is, in fact, a lie.
 	 */
-	if (efi_enabled(EFI_MEMMAP))
+	if (efi_enabled(EFI_MEMMAP) && !efi_enabled(EFI_MEMMAP_CORRECT))
 		efi_reserve_boot_services();
 
 	/* preallocate 4k for mptable mpc */
-- 
1.7.11.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists