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: <20120306023700.GE12818@truffala.fritz.box>
Date:	Tue, 6 Mar 2012 13:37:00 +1100
From:	David Gibson <david@...son.dropbear.id.au>
To:	Hillf Danton <dhillf@...il.com>
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 08:33:51PM +0800, Hillf Danton wrote:
> 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);

Sorry for the very delayed reply.  Somehow I never spotted this when
it first came.  I think I must have acidentally deleted it when
cleaning out automated messages and spam.

> Page mapping is used in unmap_ref_private(), and I am
> wondering it no longer works:-(

Good point.  But unmap_ref_private() does take the vma, so it should
be able to get to the mapping from there.  I'll respin doing that,
instead of using page_private().

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

Because alloc_huge_page() also takes vma.  Yeah, fair enough.  I'll
change that in the respin too.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
--
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