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: <Z8HlvyKod4pbi6le@casper.infradead.org>
Date: Fri, 28 Feb 2025 16:35:11 +0000
From: Matthew Wilcox <willy@...radead.org>
To: Zi Yan <ziy@...dia.com>
Cc: Liu Shixin <liushixin2@...wei.com>,
	Baolin Wang <baolin.wang@...ux.alibaba.com>, linux-mm@...ck.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	Barry Song <baohua@...nel.org>,
	David Hildenbrand <david@...hat.com>,
	Kefeng Wang <wangkefeng.wang@...wei.com>,
	Lance Yang <ioworker0@...il.com>,
	Ryan Roberts <ryan.roberts@....com>,
	Hugh Dickins <hughd@...gle.com>,
	Charan Teja Kalla <quic_charante@...cinc.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/migrate: fix shmem xarray update during migration

On Fri, Feb 28, 2025 at 10:42:19AM -0500, Zi Yan wrote:
> @@ -524,7 +525,11 @@ static int __folio_migrate_mapping(struct address_space *mapping,
>  			folio_set_swapcache(newfolio);
>  			newfolio->private = folio_get_private(folio);
>  		}
> -		entries = nr;
> +		/* shmem uses high-order entry */
> +		if (shmem_mapping(mapping))

It's be cheaper to check folio_test_anon() here, right?

Also, how did this bug remain unnoticed for almost 4 years?
Our testing is terrible ;-(

> +			entries = 1;
> +		else
> +			entries = nr;
>  	} else {
>  		VM_BUG_ON_FOLIO(folio_test_swapcache(folio), folio);
>  		entries = 1;
> -- 
> 2.47.2
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ