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>] [day] [month] [year] [list]
Date:	Mon, 3 Feb 2014 15:39:57 -0800 (PST)
From:	David Rientjes <rientjes@...gle.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
cc:	linux-kernel@...r.kernel.org, mm-commits@...r.kernel.org,
	ptesarik@...e.cz
Subject: Re: + arch-x86-mm-numa_32c-fix-the-initialization-of-physnode_map.patch
 added to -mm tree

On Mon, 3 Feb 2014, akpm@...ux-foundation.org wrote:

> From: Petr Tesarik <ptesarik@...e.cz>
> Subject: arch/x86/mm/numa_32.c: fix the initialization of physnode_map
> 
> With DISCONTIGMEM, the mapping between a pfn and its owning node is
> initialized using data provided by the BIOS.  However, the initialization
> may fail if the extents are not aligned to section boundary (64M).
> 
> The symptom of this bug is an early boot failure in pfn_to_page(), as it
> tries to access NODE_DATA(__nid) using index from an unitialized element
> of the physnode_map[] array.
> 
> While the bug is always present, it is more likely to be hit in kdump
> kernels on large machines, because:
> 
> 1. The memory map for a kdump kernel is specified as exactmap, and
>    exactmap is more likely to be unaligned.
> 
> 2. Large reservations are more likely to span across a 64M boundary.
> 
> Signed-off-by: Petr Tesarik <ptesarik@...e.cz>
> Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
> ---
> 
>  arch/x86/mm/numa_32.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff -puN arch/x86/mm/numa_32.c~arch-x86-mm-numa_32c-fix-the-initialization-of-physnode_map arch/x86/mm/numa_32.c
> --- a/arch/x86/mm/numa_32.c~arch-x86-mm-numa_32c-fix-the-initialization-of-physnode_map
> +++ a/arch/x86/mm/numa_32.c
> @@ -52,6 +52,8 @@ void memory_present(int nid, unsigned lo
>  			nid, start, end);
>  	printk(KERN_DEBUG "  Setting physnode_map array to node %d for pfns:\n", nid);
>  	printk(KERN_DEBUG "  ");
> +	pfn = round_down(pfn, PAGES_PER_SECTION);
> +	end = round_up(end, PAGES_PER_SECTION);
>  	for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION) {
>  		physnode_map[pfn / PAGES_PER_SECTION] = nid;
>  		printk(KERN_CONT "%lx ", pfn);

This is the buggy version of the patch which erroneously rounds down the 
uninitialized "pfn" rather than "start".  hpa has already merged the 
corrected patch into x86/urgent.
--
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