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: <20210517125859.GA25228@linux>
Date:   Mon, 17 May 2021 14:59:03 +0200
From:   Oscar Salvador <osalvador@...e.de>
To:     Naoya Horiguchi <nao.horiguchi@...il.com>
Cc:     Muchun Song <songmuchun@...edance.com>, linux-mm@...ck.org,
        Andrew Morton <akpm@...ux-foundation.org>,
        Mike Kravetz <mike.kravetz@...cle.com>,
        Michal Hocko <mhocko@...e.com>,
        Tony Luck <tony.luck@...el.com>,
        Naoya Horiguchi <naoya.horiguchi@....com>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 2/2] mm,hwpoison: make get_hwpoison_page call
 get_any_page()

On Mon, May 17, 2021 at 01:54:01PM +0900, Naoya Horiguchi wrote:
>  static int __get_hwpoison_page(struct page *page)
>  {
>  	struct page *head = compound_head(page);
> @@ -1098,7 +1091,9 @@ static int __get_hwpoison_page(struct page *page)
>  
>  #ifdef CONFIG_HUGETLB_PAGE
>  	spin_lock(&hugetlb_lock);
> -	if (PageHuge(head) && (HPageFreed(head) || HPageMigratable(head)))
> +	if (!PageHuge(head))
> +		ret = -EBUSY;

Unless I'm missing something, we will be returning -EBUSY for any non-hugetlb
page, which is not right.
I think what you want is to return -EBUSY in case the page is a hugetlb page
but we cannot grab a refcount because the page is in a floating state, meaning
!HPageFreed && !HPageMigratable.

Right?

-- 
Oscar Salvador
SUSE L3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ