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] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.02.1407211544280.29389@chino.kir.corp.google.com>
Date:	Mon, 21 Jul 2014 15:46:14 -0700 (PDT)
From:	David Rientjes <rientjes@...gle.com>
To:	"Huangpeng (Peter)" <peter.huangpeng@...wei.com>
cc:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
	"mhocko@...e.cz" <mhocko@...e.cz>,
	"liwanp@...ux.vnet.ibm.com" <liwanp@...ux.vnet.ibm.com>,
	"n-horiguchi@...jp.nec.com" <n-horiguchi@...jp.nec.com>,
	"iamjoonsoo.kim@....com" <iamjoonsoo.kim@....com>,
	"linux-mm@...ck.org" <linux-mm@...ck.org>,
	"Wulizhen (Pss)" <pss.wulizhen@...wei.com>
Subject: Re: [PATCH] mm:bugfix, pfn_valid sometimes return incorrect when memmap parameter specified

On Mon, 21 Jul 2014, Huangpeng (Peter) wrote:

> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
> index 835aa3d..c54284b 100644
> --- a/include/linux/mmzone.h
> +++ b/include/linux/mmzone.h
> @@ -1199,7 +1199,7 @@ static inline struct mem_section *__pfn_to_section(unsigned long pfn)
>  #ifndef CONFIG_HAVE_ARCH_PFN_VALID
>  static inline int pfn_valid(unsigned long pfn)
>  {
> - if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS)
> + if (pfn >= max_pfn || pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS)
>   return 0;
>   return valid_section(__nr_to_section(pfn_to_section_nr(pfn)));
>  }

Why should valid_section() return non-zero for sparsemem if it is above 
max_pfn?  (I think you're modifying the wrong function.)

Your patch is also whitespace damaged and cannot be applied, please see 
Documentation/SubmittingPatches which also references 
Documentation/email-clients.txt.

> diff --git a/mm/nobootmem.c b/mm/nobootmem.c
> index 04a9d94..7eb273e 100644
> --- a/mm/nobootmem.c
> +++ b/mm/nobootmem.c
> @@ -31,7 +31,7 @@ EXPORT_SYMBOL(contig_page_data);
>  unsigned long max_low_pfn;
>  unsigned long min_low_pfn;
>  unsigned long max_pfn;
> -
> +EXPORT_SYMBOL(max_pfn);
>  static void * __init __alloc_memory_core_early(int nid, u64 size, u64 align,
>   u64 goal, u64 limit)
>  {

This is an unrelated change.
--
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