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:	Sun, 16 Mar 2008 19:19:45 -0700
From:	"Yinghai Lu" <yhlu.kernel@...il.com>
To:	"Andi Kleen" <andi@...stfloor.org>
Cc:	linux-kernel@...r.kernel.org, pj@....com, linux-mm@...ck.org,
	nickpiggin@...oo.com.au
Subject: Re: [PATCH] [11/18] Fix alignment bug in bootmem allocator

On Sun, Mar 16, 2008 at 6:58 PM, Andi Kleen <andi@...stfloor.org> wrote:
>
>  Without this fix bootmem can return unaligned addresses when the start of a
>  node is not aligned to the align value. Needed for reliably allocating
>  gigabyte pages.
>  Signed-off-by: Andi Kleen <ak@...e.de>
>
>  ---
>   mm/bootmem.c |    4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
>  Index: linux/mm/bootmem.c
>  ===================================================================
>  --- linux.orig/mm/bootmem.c
>  +++ linux/mm/bootmem.c
>  @@ -197,6 +197,7 @@ __alloc_bootmem_core(struct bootmem_data
>   {
>         unsigned long offset, remaining_size, areasize, preferred;
>         unsigned long i, start = 0, incr, eidx, end_pfn;
>  +       unsigned long pfn;
>         void *ret;
>
>         if (!size) {
>  @@ -239,12 +240,13 @@ __alloc_bootmem_core(struct bootmem_data
>         preferred = PFN_DOWN(ALIGN(preferred, align)) + offset;
>         areasize = (size + PAGE_SIZE-1) / PAGE_SIZE;
>         incr = align >> PAGE_SHIFT ? : 1;
>  +       pfn = PFN_DOWN(bdata->node_boot_start);
>
>   restart_scan:
>         for (i = preferred; i < eidx; i += incr) {
>                 unsigned long j;
>                 i = find_next_zero_bit(bdata->node_bootmem_map, eidx, i);
>  -               i = ALIGN(i, incr);
>  +               i = ALIGN(pfn + i, incr) - pfn;
>                 if (i >= eidx)
>                         break;
>                 if (test_bit(i, bdata->node_bootmem_map))
>  --

node_boot_start is not page aligned?

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