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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 22 May 2008 01:14:16 +0200
From:	Johannes Weiner <hannes@...urebad.de>
To:	"Yinghai Lu" <yhlu.kernel@...il.com>
Cc:	"Jeremy Fitzhardinge" <jeremy@...p.org>,
	"Ingo Molnar" <mingo@...e.hu>,
	"kernel list" <linux-kernel@...r.kernel.org>,
	"Thomas Gleixner" <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>
Subject: Re: Suspected regression in "x86: extend e820 ealy_res support 32bit"

Hi,

"Yinghai Lu" <yhlu.kernel@...il.com> writes:

> On Wed, May 21, 2008 at 11:19 AM, Jeremy Fitzhardinge <jeremy@...p.org> wrote:
>> I'm seeing a crash in current x86.git tip/auto-latest when booting under
>> Xen.  The crash is rather early, but it's in __alloc_bootmem_core() in the
>> final memset clear.  Apparently the allocator is returning a bad page.
>>
>> This points to changes in the setup of the bootmem allocator, and the
>> changes "x86: extend e820 ealy_res support 32bit" make to
>> arch/x86/kernel/setup_32.c:setup_bootmem_allocator() looks like the most
>> likely suspect.  Unfortunately its a rather large patch which is not easy to
>> revert, so I haven't actually confirmed this yet.
>
>
> thanks. please check the attached patch
>
> YH
>
> [PATCH] x86: bootmap size fix for 32 bit
>
> Jeremy Fitzhardinge found
> x86: extend e820 ealy_res support 32bit
> cause regression...
>
> in setup_bootmem_allocator
>
> Signed-off-by: Yinghai Lu <yhlu.kernel@...il.com>
>
> diff --git a/arch/x86/kernel/setup_32.c b/arch/x86/kernel/setup_32.c
> index f38d840..938c7b3 100644
> --- a/arch/x86/kernel/setup_32.c
> +++ b/arch/x86/kernel/setup_32.c
> @@ -566,17 +566,22 @@ static void __init relocate_initrd(void)
>  
>  void __init setup_bootmem_allocator(void)
>  {
> +	unsigned long bootmap_pages;
>  	unsigned long bootmap_size, bootmap;
>  	/*
>  	 * Initialize the boot-time allocator (with low memory only):
>  	 */
> -	bootmap_size = bootmem_bootmap_pages(max_low_pfn)<<PAGE_SHIFT;
> +	bootmap_pages = bootmem_bootmap_pages(max_low_pfn)<<PAGE_SHIFT;

Forgot to remove the shift?

>  	bootmap = find_e820_area(min_low_pfn<<PAGE_SHIFT,
> -				 max_low_pfn<<PAGE_SHIFT, bootmap_size,
> +				 max_low_pfn<<PAGE_SHIFT,
> +				 bootmap_pages<<PAGE_SHIFT,

Because this value is hardly sane anymore.

>  				 PAGE_SIZE);
>  	if (bootmap == -1L)
>  		panic("Cannot find bootmem map of size %ld\n", bootmap_size);
>  	bootmap_size = init_bootmem(bootmap >> PAGE_SHIFT, max_low_pfn);
> +	printk(KERN_INFO "  bootmap [%016lx -  %016lx] pages %lx\n",
> +		 bootmap, bootmap + bootmap_size - 1,
> +		 bootmap_pages);
>  	register_bootmem_low_pages(max_low_pfn);
>  	early_res_to_bootmem(0, max_low_pfn<<PAGE_SHIFT);
>  	reserve_bootmem(bootmap, bootmap_size, BOOTMEM_DEFAULT);

Besides, what did you want to accomplish?

	Hannes
--
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