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:   Sat, 4 Nov 2023 17:20:54 +0000
From:   Matthew Wilcox <willy@...radead.org>
To:     Kefeng Wang <wangkefeng.wang@...wei.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        David Hildenbrand <david@...hat.com>,
        linux-s390@...r.kernel.org
Subject: Re: [PATCH v2 06/10] mm: memory: use a folio in zap_pte_range()

On Sat, Nov 04, 2023 at 11:55:18AM +0800, Kefeng Wang wrote:
> -/* Decides whether we should zap this page with the page pointer specified */
> -static inline bool should_zap_page(struct zap_details *details, struct page *page)
> +/* Decides whether we should zap this folio with the folio pointer specified */
> +static inline bool should_zap_page(struct zap_details *details, struct folio *folio)

Surely we should rename this to should_zap_folio()?

> @@ -1487,10 +1492,10 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb,
>  			 * see zap_install_uffd_wp_if_needed().
>  			 */
>  			WARN_ON_ONCE(!vma_is_anonymous(vma));
> -			rss[mm_counter(page)]--;
> +			rss[mm_counter(&folio->page)]--;
>  			if (is_device_private_entry(entry))
> -				page_remove_rmap(page, vma, false);
> -			put_page(page);
> +				page_remove_rmap(&folio->page, vma, false);
> +			folio_put(folio);

This is wrong.  If we have a PTE-mapped THP, you'll remove the head page
N times instead of removing each of N pages.

I suspect you're going to collide with Ryan's work by doing this ...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ