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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 21 Jan 2024 02:00:51 +0000
From: Matthew Wilcox <willy@...radead.org>
To: Miaohe Lin <linmiaohe@...wei.com>
Cc: naoya.horiguchi@....com, akpm@...ux-foundation.org, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/memory-failure: fix crash in split_huge_page_to_list
 from soft_offline_page

On Sat, Jan 20, 2024 at 02:57:29PM +0800, Miaohe Lin wrote:
> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
> index 636280d04008..20058f7ac3e9 100644
> --- a/mm/memory-failure.c
> +++ b/mm/memory-failure.c
> @@ -1377,8 +1377,13 @@ void ClearPageHWPoisonTakenOff(struct page *page)
>   */
>  static inline bool HWPoisonHandlable(struct page *page, unsigned long flags)
>  {
> -	/* Soft offline could migrate non-LRU movable pages */
> -	if ((flags & MF_SOFT_OFFLINE) && __PageMovable(page))
> +	/*
> +	 * Soft offline could migrate non-LRU movable pages.
> +	 * Note that page->mapping is overloaded with slab->slab_list or slabs
> +	 * fields which might make slab pages appear like non-LRU movable pages.
> +	 * So __PageMovable() has to be done after PageSlab() is checked.
> +	 */
> +	if ((flags & MF_SOFT_OFFLINE) && !PageSlab(page) && __PageMovable(page))
>  		return true;
>  
>  	return PageLRU(page) || is_free_buddy_page(page);

I think would make more sense as

+	if (PageSlab(page))
+		return false;

.. and then leave the rest alone (including not touching the comment)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ