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]
Message-ID: <20100818030200.GA19799@spritzera.linux.bs1.fc.nec.co.jp>
Date:	Wed, 18 Aug 2010 12:02:00 +0900
From:	Naoya Horiguchi <n-horiguchi@...jp.nec.com>
To:	David Rientjes <rientjes@...gle.com>
Cc:	Andi Kleen <andi@...stfloor.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Christoph Lameter <cl@...ux-foundation.org>,
	Mel Gorman <mel@....ul.ie>,
	Wu Fengguang <fengguang.wu@...el.com>,
	"Jun'ichi Nomura" <j-nomura@...jp.nec.com>,
	linux-mm <linux-mm@...ck.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/9] hugetlb: add allocate function for hugepage migration

Hi,

On Mon, Aug 16, 2010 at 11:51:30PM -0700, David Rientjes wrote:
> On Tue, 10 Aug 2010, Naoya Horiguchi wrote:
...
> > +/*
> > + * This allocation function is useful in the context where vma is irrelevant.
> > + * E.g. soft-offlining uses this function because it only cares physical
> > + * address of error page.
> > + */
> > +struct page *alloc_huge_page_no_vma_node(struct hstate *h, int nid)
> > +{
> > +	struct page *page;
> > +
> > +	spin_lock(&hugetlb_lock);
> > +	get_mems_allowed();
> 
> Why is this calling get_mems_allowed()?  dequeue_huge_page_node() isn't 
> concerned if nid can be allocated by current in this context.

OK, I'll remove this.

> > +	page = dequeue_huge_page_node(h, nid);
> > +	put_mems_allowed();
> > +	spin_unlock(&hugetlb_lock);
> > +
> > +	if (!page) {
> > +		page = alloc_buddy_huge_page_node(h, nid);
> > +		if (!page) {
> > +			__count_vm_event(HTLB_BUDDY_PGALLOC_FAIL);
> >  			return NULL;
> > -		}
> > -		prep_new_huge_page(h, page, nid);
> > +		} else
> > +			__count_vm_event(HTLB_BUDDY_PGALLOC);
> >  	}
> >  
> > +	set_page_refcounted(page);
> 
> Possibility of NULL pointer dereference?

I think this allocate function returns without calling
set_page_refcounted() if page == NULL.  Or do you mean another point?

Thanks,
Naoya Horiguchi
--
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