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]
Date: Thu, 16 May 2024 16:45:22 +0800
From: Miaohe Lin <linmiaohe@...wei.com>
To: Oscar Salvador <osalvador@...e.de>, David Hildenbrand <david@...hat.com>
CC: <akpm@...ux-foundation.org>, <shy828301@...il.com>,
	<nao.horiguchi@...il.com>, <xuyu@...ux.alibaba.com>, <linux-mm@...ck.org>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] mm/huge_memory: don't unpoison huge_zero_folio

On 2024/5/16 16:26, Oscar Salvador wrote:
> On Wed, May 15, 2024 at 05:55:39PM +0200, David Hildenbrand wrote:
>>> +	if (is_huge_zero_folio(folio)) {
>>> +		unpoison_pr_info("Unpoison: huge zero page is not supported %#lx\n",
>>> +				 pfn, &unpoison_rs);
>>> +		goto unlock_mutex;
>>> +	}
>>> +
> 
> Sorry for spamming your reply David, but for some unknown reason I am not able
> to find the original patch in my mailbox, in none of the two accountes I am
> subscribed, so I guess I will have to reply here.
> 
> Just two things
> 
> 1) We do not care if someone grabs a refcount for huge_zero_folio,
>    because since it is not supported anyway the outcome will not change.
>    Also, AFAIK, there is no chance we can unpoison that folio.
>    Therefore, I would just lift the check two blocks and place it right after
>    the hw_memory_failure check.
> 
> 2) The whole thing is unsupported, but you will return -EBUSY while you
>    should be returning -EOPNOTSUPP AFAICS.
> 

Thanks for your comment. Do you mean something like below?

diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 16ada4fb02b7..a9fe9eda593f 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -2546,6 +2546,13 @@ int unpoison_memory(unsigned long pfn)
                goto unlock_mutex;
        }

+       if (is_huge_zero_folio(folio)) {
+               unpoison_pr_info("Unpoison: huge zero page is not supported %#lx\n",
+                                pfn, &unpoison_rs);
+               ret = -EOPNOTSUPP;
+               goto unlock_mutex;
+       }
+
        if (!PageHWPoison(p)) {
                unpoison_pr_info("Unpoison: Page was already unpoisoned %#lx\n",
                                 pfn, &unpoison_rs);

Thanks.
.

> with that you can add:
> 
> Reviewed-by: Oscar Salvador <osalvador@...e.de>
> 
>  
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ