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  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20080108083044.GI31838@elte.hu>
Date:	Tue, 8 Jan 2008 09:30:44 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	"H. Peter Anvin" <hpa@...or.com>
Cc:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Thomas Gleixer <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	Dhaval Giani <dhaval@...ux.vnet.ibm.com>, vgoyal@...hat.com,
	hbabu@...ibm.com, kexec@...ts.infradead.org
Subject: Re: [PATCH] i386: handle an initrd in highmem (version 2)


* H. Peter Anvin <hpa@...or.com> wrote:

> Fix crash on NUMA reported by Dhaval Giani (reported as being a kexec 
> issue.)

here's the delta fix.

	Ingo

Index: linux-x86.q/arch/x86/kernel/setup_32.c
===================================================================
--- linux-x86.q.orig/arch/x86/kernel/setup_32.c
+++ linux-x86.q/arch/x86/kernel/setup_32.c
@@ -510,16 +510,20 @@ static void __init reserve_initrd(void)
 	unsigned long end_of_lowmem = max_low_pfn << PAGE_SHIFT;
 	unsigned long ramdisk_here;
 
+	initrd_start = 0;
+
+	if (!boot_params.hdr.type_of_loader ||
+	    !ramdisk_image || !ramdisk_size)
+		return;		/* No initrd provided by bootloader */
+
 	if (ramdisk_end < ramdisk_image) {
-		printk(KERN_ERR "initrd wraps around end of memory\n"
-		       KERN_ERR "disabling initrd\n");
-		initrd_start = 0;
+		printk(KERN_ERR "initrd wraps around end of memory, "
+		       "disabling initrd\n");
 		return;
 	}
 	if (ramdisk_size >= end_of_lowmem/2) {
-		printk(KERN_ERR "initrd too large to handle\n"
-		       KERN_ERR "disabling initrd\n");
-		initrd_start = 0;
+		printk(KERN_ERR "initrd too large to handle, "
+		       "disabling initrd\n");
 		return;
 	}
 	if (ramdisk_end <= end_of_lowmem) {
@@ -554,9 +558,10 @@ static void __init relocate_initrd(void)
 	char *p, *q;
 
 	if (!do_relocate_initrd)
-		return;		/* Nothing to do here... */
+		return;
 
 	ramdisk_here = initrd_start - PAGE_OFFSET;
+
 	q = (char *)initrd_start;
 
 	/* Copy any lowmem portion of the initrd */
@@ -642,11 +647,10 @@ void __init setup_bootmem_allocator(void
 	 */
 	find_smp_config();
 #endif
-	numa_kva_reserve();
 #ifdef CONFIG_BLK_DEV_INITRD
-	if (boot_params.hdr.type_of_loader && boot_params.hdr.ramdisk_image)
-		reserve_initrd();
+	reserve_initrd();
 #endif
+	numa_kva_reserve();
 	reserve_crashkernel();
 }
 
@@ -799,12 +803,13 @@ void __init setup_arch(char **cmdline_p)
 	/*
 	 * NOTE: at this point the bootmem allocator is fully available.
 	 */
-	paravirt_post_allocator_init();
 
 #ifdef CONFIG_BLK_DEV_INITRD
 	relocate_initrd();
 #endif
 
+	paravirt_post_allocator_init();
+
 	dmi_scan_machine();
 
 	io_delay_init();
Index: linux-x86.q/arch/x86/mm/discontig_32.c
===================================================================
--- linux-x86.q.orig/arch/x86/mm/discontig_32.c
+++ linux-x86.q/arch/x86/mm/discontig_32.c
@@ -288,8 +288,8 @@ unsigned long __init setup_memory(void)
 
 #ifdef CONFIG_BLK_DEV_INITRD
 	/* Numa kva area is below the initrd */
-	if (boot_params.hdr.type_of_loader && boot_params.hdr.ramdisk_image)
-		kva_start_pfn = PFN_DOWN(boot_params.hdr.ramdisk_image)
+	if (initrd_start)
+		kva_start_pfn = PFN_DOWN(initrd_start - PAGE_OFFSET)
 			- kva_pages;
 #endif
 	kva_start_pfn -= kva_start_pfn & (PTRS_PER_PTE-1);
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ