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: <d93e5427-7cc9-4b34-a9f3-c9e8e991736b@linux.dev>
Date: Sat, 6 Dec 2025 14:24:01 +0800
From: Lance Yang <lance.yang@...ux.dev>
To: david@...nel.org
Cc: Liam.Howlett@...cle.com, akpm@...ux-foundation.org,
 aneesh.kumar@...nel.org, arnd@...db.de, harry.yoo@...cle.com,
 jannh@...gle.com, linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org,
 linux-mm@...ck.org, liushixin2@...wei.com, loberman@...hat.com,
 lorenzo.stoakes@...cle.com, muchun.song@...ux.dev, nadav.amit@...il.com,
 npiggin@...il.com, osalvador@...e.de, peterz@...radead.org,
 pfalcato@...e.de, prakash.sangappa@...cle.com, riel@...riel.com,
 stable@...r.kernel.org, vbabka@...e.cz, will@...nel.org,
 Lance Yang <ioworker0@...il.com>
Subject: Re: [PATCH v1 1/4] mm/hugetlb: fix hugetlb_pmd_shared()



On 2025/12/6 13:55, Lance Yang wrote:
> From: Lance Yang <lance.yang@...ux.dev>
> 
> 
> On Fri,  5 Dec 2025 22:35:55 +0100, David Hildenbrand (Red Hat) wrote:
>> We switched from (wrongly) using the page count to an independent
>> shared count. Now, shared page tables have a refcount of 1 (excluding
>> speculative references) and instead use ptdesc->pt_share_count to
>> identify sharing.
>>
>> We didn't convert hugetlb_pmd_shared(), so right now, we would never
>> detect a shared PMD table as such, because sharing/unsharing no longer
>> touches the refcount of a PMD table.
>>
>> Page migration, like mbind() or migrate_pages() would allow for migrating
>> folios mapped into such shared PMD tables, even though the folios are
>> not exclusive. In smaps we would account them as "private" although they
>> are "shared", and we would be wrongly setting the PM_MMAP_EXCLUSIVE in the
>> pagemap interface.
>>
>> Fix it by properly using ptdesc_pmd_is_shared() in hugetlb_pmd_shared().
>>
>> Fixes: 59d9094df3d7 ("mm: hugetlb: independent PMD page table shared count")
>> Cc: <stable@...r.kernel.org>
>> Cc: Liu Shixin <liushixin2@...wei.com>
>> Signed-off-by: David Hildenbrand (Red Hat) <david@...nel.org>
>> ---
> 
> Good catch! Feel free to add:
> 
> Reviewed-by: Lance yang <lance.yang@...ux.dev>

Actually:

Reviewed-by: Lance Yang <lance.yang@...ux.dev>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ