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:	Tue, 17 Jun 2008 18:59:28 +0200
From:	Johannes Weiner <hannes@...urebad.de>
To:	Yasunori Goto <y-goto@...fujitsu.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Ingo Molnar <mingo@...e.hu>,
	Yinghai Lu <yhlu.kernel@...il.com>,
	Andi Kleen <andi@...stfloor.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Fix new alloc_bootmem_core (Re: [PATCH -mm 08/14] bootmem: clean up alloc_bootmem_core)

Hi,

Yasunori Goto <y-goto@...fujitsu.com> writes:

> Hi Johannes-san.
>
> I found a bug in this patch.
>
>
>> -	eidx = end_pfn - PFN_DOWN(node_boot_start);
>> +	if (goal && goal < max)
>> +		start = ALIGN(goal, step);
>> +	else
>> +		start = ALIGN(min, step);
>
> Here should check (min < goal) too.
>
> If not, start can becomes smaller than min. and sidx doesn't point
> correct index.
> alloc_bootmem_node() almost allocates pages of other node,
> when node's min address is over MAX_DMA_ADDRESS.

Oh, good catch!

> Bye.
>
> ----
>
> Fix new alloc_bootmem_core() of bootmem-clean-up-alloc_bootmem_core.patch
> in 2.6.26-rc5-mm3.
>
> (min < goal) should be checked too.
>
>
> Signed-off-by: Yasunori Goto <y-goto@...fujitsu.com>
> CC: Johannes Weiner <hannes@...urebad.de>
  Acked-by: Johannes Weiner <hannes@...urebad.de>

> ---
>  mm/bootmem.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Index: current/mm/bootmem.c
> ===================================================================
> --- current.orig/mm/bootmem.c	2008-06-17 18:33:31.000000000 +0900
> +++ current/mm/bootmem.c	2008-06-17 18:34:27.000000000 +0900
> @@ -435,7 +435,7 @@
>  
>  	step = max(align >> PAGE_SHIFT, 1UL);
>  
> -	if (goal && goal < max)
> +	if (goal && min < goal && goal < max)
>  		start = ALIGN(goal, step);
>  	else
>  		start = ALIGN(min, step);

	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