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: <aA86d6L6GhAjnri1@localhost.localdomain>
Date: Mon, 28 Apr 2025 10:21:11 +0200
From: Oscar Salvador <osalvador@...e.de>
To: Kairui Song <kasong@...cent.com>
Cc: linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
	David Hildenbrand <david@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/memory: fix mapcount / refcount sanity check for mTHP
 reuse

On Fri, Apr 25, 2025 at 03:43:25PM +0800, Kairui Song wrote:
> From: Kairui Song <kasong@...cent.com>
> 
> The following WARNING was triggered during swap stress test with
> mTHP enabled:
... 
> The WARN_ON here is simply incorrect. The refcount here must be at least
> the mapcount, not the opposite. Each mapcount must have a corresponding
> refcount, but the refcount may increase if other components grab the
> folio, which is acceptable. Meanwhile, having a mapcount larger than
> refcount is a real problem.
> 
> So fix the WARN_ON condition.
> 
> Fixes: 1da190f4d0a6 ("mm: Copy-on-Write (COW) reuse support for PTE-mapped THP")
> Reported-by: Kairui Song <kasong@...cent.com>
> Closes: https://lore.kernel.org/all/CAMgjq7D+ea3eg9gRCVvRnto3Sv3_H3WVhupX4e=k8T5QAfBHbw@mail.gmail.com/
> Suggested-by: David Hildenbrand <david@...hat.com>
> Signed-off-by: Kairui Song <kasong@...cent.com>

Reviewed-by: Oscar Salvador <osalvador@...e.de>


-- 
Oscar Salvador
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ