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: <YK/44mOnwZgUOdYA@dhcp22.suse.cz>
Date:   Thu, 27 May 2021 21:54:10 +0200
From:   Michal Hocko <mhocko@...e.com>
To:     Mike Kravetz <mike.kravetz@...cle.com>
Cc:     Naoya Horiguchi <nao.horiguchi@...il.com>, linux-mm@...ck.org,
        Oscar Salvador <osalvador@...e.de>,
        Muchun Song <songmuchun@...edance.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        David Hildenbrand <david@...hat.com>,
        Naoya Horiguchi <naoya.horiguchi@....com>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] hugetlb: pass head page to remove_hugetlb_page()

On Thu 27-05-21 09:28:51, Mike Kravetz wrote:
> On 5/26/21 4:52 PM, Naoya Horiguchi wrote:
> > From: Naoya Horiguchi <naoya.horiguchi@....com>
> > 
> > When memory_failure() or soft_offline_page() is called on a tail page of
> > some hugetlb page, "BUG: unable to handle page fault" error can be
> > triggered.
> > 
> > remove_hugetlb_page() dereferences page->lru, so it's assumed that the
> > page points to a head page, but one of the caller,
> > dissolve_free_huge_page(), provides remove_hugetlb_page() with 'page'
> > which could be a tail page.  So pass 'head' to it, instead.
> > 
> > Fixes: 6eb4e88a6d27 ("hugetlb: create remove_hugetlb_page() to separate functionality")
> > Signed-off-by: Naoya Horiguchi <naoya.horiguchi@....com>
> > ---
> >  mm/hugetlb.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git v5.13-rc3/mm/hugetlb.c v5.13-rc3_patched/mm/hugetlb.c
> > index 95918f410c0f..470f7b5b437e 100644
> > --- v5.13-rc3/mm/hugetlb.c
> > +++ v5.13-rc3_patched/mm/hugetlb.c
> > @@ -1793,7 +1793,7 @@ int dissolve_free_huge_page(struct page *page)
> >  			SetPageHWPoison(page);
> >  			ClearPageHWPoison(head);
> >  		}
> > -		remove_hugetlb_page(h, page, false);
> > +		remove_hugetlb_page(h, head, false);
> >  		h->max_huge_pages--;
> >  		spin_unlock_irq(&hugetlb_lock);
> >  		update_and_free_page(h, head);
> > 
> 
> I believe we have the same problem later in the routine when calling
> add_hugetlb_page()?

Can we ever get a tail page there?

> If so, should we combine the changes?  Or, do we need two patches as
> the bugs were introduced with different commits?

If there is an issue then I would go with a separate patch.

Thanks!
-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ