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: <ZLIbZygG7LqSI9xe@casper.infradead.org>
Date:   Sat, 15 Jul 2023 05:07:03 +0100
From:   Matthew Wilcox <willy@...radead.org>
To:     Sidhartha Kumar <sidhartha.kumar@...cle.com>
Cc:     linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        akpm@...ux-foundation.org, linmiaohe@...wei.com,
        naoya.horiguchi@....com
Subject: Re: [PATCH mm-unstable 8/8] mm/memory-failure: convert
 unpoison_memory() to folios

On Thu, Jan 12, 2023 at 02:46:08PM -0600, Sidhartha Kumar wrote:
> @@ -2348,7 +2347,6 @@ int unpoison_memory(unsigned long pfn)
>  		return -ENXIO;
>  
>  	p = pfn_to_page(pfn);
> -	page = compound_head(p);
>  	folio = page_folio(p);
>  
>  	mutex_lock(&mf_mutex);
> @@ -2360,31 +2358,31 @@ int unpoison_memory(unsigned long pfn)
>  		goto unlock_mutex;
>  	}
>  
> -	if (!PageHWPoison(p)) {
> +	if (!folio_test_hwpoison(folio)) {

This is wrong.  You need to test the individual page for PageHWPoison()
instead of testing the folio.  I understand that this will work for
hugetlbfs pages, but for THP, it's the individual pages that get poisoned,
and folio_test_hwpoison() on a THP actually only tests the head page.

Ideas for preventing this mistake in the future gratefully received.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ