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: <aUWXAGC1028jRKEY@casper.infradead.org>
Date: Fri, 19 Dec 2025 18:18:40 +0000
From: Matthew Wilcox <willy@...radead.org>
To: Jane Chu <jane.chu@...cle.com>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
	stable@...r.kernel.org, muchun.song@...ux.dev, osalvador@...e.de,
	david@...nel.org, linmiaohe@...wei.com, jiaqiyan@...gle.com,
	william.roche@...cle.com, rientjes@...gle.com,
	akpm@...ux-foundation.org, lorenzo.stoakes@...cle.com,
	Liam.Howlett@...cle.com, rppt@...nel.org, surenb@...gle.com,
	mhocko@...e.com
Subject: Re: [PATCH v2] mm/memory-failure: teach kill_accessing_process to
 accept hugetlb tail page pfn

On Fri, Dec 19, 2025 at 10:55:16AM -0700, Jane Chu wrote:
>  static int check_hwpoisoned_entry(pte_t pte, unsigned long addr, short shift,
> -				unsigned long poisoned_pfn, struct to_kill *tk)
> +				unsigned long poisoned_pfn, struct to_kill *tk,
> +				int pte_nr)

if we pass in huge_page_mask() instead ...

>  {
>  	unsigned long pfn = 0;
> +	unsigned long hwpoison_vaddr;
>  
>  	if (pte_present(pte)) {
>  		pfn = pte_pfn(pte);
> @@ -694,10 +696,11 @@ static int check_hwpoisoned_entry(pte_t pte, unsigned long addr, short shift,
>  			pfn = swp_offset_pfn(swp);
>  	}
>  
> -	if (!pfn || pfn != poisoned_pfn)
> +	if (!pfn || (pfn > poisoned_pfn || (pfn + pte_nr - 1) < poisoned_pfn))

... then we can simplify this to:

	if (!pfn || ((pfn | mask) != (poisoned_pfn | mask))

>  		return 0;
> @@ -2037,6 +2038,7 @@ static int try_memory_failure_hugetlb(unsigned long pfn, int flags, int *hugetlb
>  		return action_result(pfn, MF_MSG_GET_HWPOISON, MF_IGNORED);
>  	}
>  
> +
>  	folio = page_folio(p);
>  	folio_lock(folio);

unnecessary whitespace change

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ