[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJd=RBAK-iTs6HfNm+Lv_5GKPbQfpALgYCgB+mitXUPofJ1gtA@mail.gmail.com>
Date: Thu, 16 Feb 2012 20:33:51 +0800
From: Hillf Danton <dhillf@...il.com>
To: David Gibson <david@...son.dropbear.id.au>
Cc: akpm@...ux-foundation.org, abarry@...y.com, hughd@...gle.com,
mgorman@...e.de, minchan.kim@...il.com, paulus@...ba.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] hugepages: Fix use after free bug in "quota" handling
On Thu, Feb 16, 2012 at 12:24 PM, David Gibson
<david@...son.dropbear.id.au> wrote:
> @@ -1046,12 +1124,12 @@ static struct page *alloc_huge_page(struct vm_area_struct *vma,
> if (!page) {
> page = alloc_buddy_huge_page(h, NUMA_NO_NODE);
> if (!page) {
> - hugetlb_put_quota(inode->i_mapping, chg);
> + hugepage_subpool_put_pages(spool, chg);
> return ERR_PTR(-VM_FAULT_SIGBUS);
> }
> }
>
> - set_page_private(page, (unsigned long) mapping);
> + set_page_private(page, (unsigned long)spool);
>
Page mapping is used in unmap_ref_private(), and I am
wondering it no longer works:-(
> @@ -2392,7 +2471,8 @@ retry_avoidcopy:
>
> /* Drop page_table_lock as buddy allocator may be called */
> spin_unlock(&mm->page_table_lock);
> - new_page = alloc_huge_page(vma, address, outside_reserve);
> + new_page = alloc_huge_page(vma, address, outside_reserve,
> + subpool_vma(vma));
Change in the number of parameters of alloc_huge_page()
looks unnecessary.
--
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