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:	Wed, 13 Feb 2013 10:07:08 +0000
From:	Matt Fleming <matt.fleming@...el.com>
To:	Xishi Qiu <qiuxishi@...wei.com>
Cc:	"Luck, Tony" <tony.luck@...el.com>, fenghua.yu@...el.com,
	Liujiang <jiang.liu@...wei.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-ia64@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-efi@...r.kernel.org, linux-mm@...ck.org,
	Hanjun Guo <guohanjun@...wei.com>,
	WuJianguo <wujianguo@...wei.com>
Subject: Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting

On Thu, 2013-02-07 at 14:09 +0800, Xishi Qiu wrote:
> > Sorry, this bug will be happen when use Sparse-Memory(section is valid, but last
> 
> > several pages are invalid). If use Flat-Memory, crash kernel will boot successfully.
> > I think the following patch would be better.
> > 
> > Hi Andrew, will you just ignore the earlier patch and consider the following one? :>
> > 
> > Signed-off-by: Xishi Qiu <qiuxishi@...wei.com>
> > ---
> >  arch/ia64/mm/init.c |    2 ++
> >  1 files changed, 2 insertions(+), 0 deletions(-)
> > 
> > diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
> > index 082e383..23f2ee3 100644
> > --- a/arch/ia64/mm/init.c
> > +++ b/arch/ia64/mm/init.c
> > @@ -213,6 +213,8 @@ free_initrd_mem (unsigned long start, unsigned long end)
> >  	for (; start < end; start += PAGE_SIZE) {
> >  		if (!virt_addr_valid(start))
> >  			continue;
> > +		if ((start >> PAGE_SHIFT) >= max_low_pfn)
> 
> I confused the vaddr and paddr, really sorry for it.
> 
> In efi_init() memory aligns in IA64_GRANULE_SIZE(16M). If set "crashkernel=1024M-:600M"
> and use sparse memory model, when crash kernel booting it changes [128M-728M] to [128M-720M].
> But initrd memory is in [709M-727M], and virt_addr_valid() *can not* check the invalid pages
> when freeing initrd memory. There are some pages missed at the end of the seciton.
> 
> ChangeLog V3:
> 	fixed vaddr mistake
> ChangeLog V2:
> 	add invalid pages check when freeing initrd memory
> 
> Signed-off-by: Xishi Qiu <qiuxishi@...wei.com>
> ---
>  arch/ia64/mm/init.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
> index 082e383..8a269f8 100644
> --- a/arch/ia64/mm/init.c
> +++ b/arch/ia64/mm/init.c
> @@ -173,6 +173,7 @@ void __init
>  free_initrd_mem (unsigned long start, unsigned long end)
>  {
>  	struct page *page;
> +	unsigned long pfn;
>  	/*
>  	 * EFI uses 4KB pages while the kernel can use 4KB or bigger.
>  	 * Thus EFI and the kernel may have different page sizes. It is
> @@ -213,6 +214,9 @@ free_initrd_mem (unsigned long start, unsigned long end)
>  	for (; start < end; start += PAGE_SIZE) {
>  		if (!virt_addr_valid(start))
>  			continue;
> +		pfn = __pa(start) >> PAGE_SHIFT;
> +		if (pfn >= max_low_pfn)
> +			continue;
>  		page = virt_to_page(start);
>  		ClearPageReserved(page);
>  		init_page_count(page);

I would have presumed that fixing this bug would involve modifying the
ia64-specific kexec code?

Tony, Fenghua? Any thoughts?

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