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: <Z5KyXrW1IXbWuvo-@google.com>
Date: Thu, 23 Jan 2025 21:19:26 +0000
From: Roman Gushchin <roman.gushchin@...ux.dev>
To: "Liam R. Howlett" <Liam.Howlett@...cle.com>,
	linux-kernel@...r.kernel.org, linux-mm@...ck.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	Jann Horn <jannh@...gle.com>, Peter Zijlstra <peterz@...radead.org>,
	Will Deacon <will@...nel.org>,
	"Aneesh Kumar K.V" <aneesh.kumar@...nel.org>,
	Nick Piggin <npiggin@...il.com>, Hugh Dickins <hughd@...gle.com>,
	linux-arch@...r.kernel.org
Subject: Re: [PATCH v3] mmu_gather: move tlb flush for VM_PFNMAP/VM_MIXEDMAP
 vmas into free_pgtables()

On Thu, Jan 23, 2025 at 02:42:56PM -0500, Liam R. Howlett wrote:
> * Roman Gushchin <roman.gushchin@...ux.dev> [250123 11:44]:
> > Commit b67fbebd4cf9 ("mmu_gather: Force tlb-flush VM_PFNMAP vmas")
> > added a forced tlbflush to tlb_vma_end(), which is required to avoid a
> > race between munmap() and unmap_mapping_range(). However it added some
> > overhead to other paths where tlb_vma_end() is used, but vmas are not
> > removed, e.g. madvise(MADV_DONTNEED).
> > 
> > Fix this by moving the tlb flush out of tlb_end_vma() into
> > free_pgtables(), somewhat similar to the stable version of the
> > original commit: e.g. stable commit 895428ee124a ("mm: Force TLB flush
> > for PFNMAP mappings before unlink_file_vma()").
> > 
> > Note, that if tlb->fullmm is set, no flush is required, as the whole
> > mm is about to be destroyed.
> > 
> > ---
> 
> Hugh didn't mean to add a ---, he meant to move the version info between
> the Cc list and the patch so that it's not in the git history.

Ah, ok, somehow it wasn't a problem previously for me, usually Andrew
was dropping the part while merging into the mm tree.
Thanks for clarifying.

> 
> You can find examples on the ML.
> 
> > 
> > v3:
> >   - added initialization of vma_pfn in __tlb_reset_range() (by Hugh D.)
> > 
> > v2:
> >   - moved vma_pfn flag handling into tlb.h (by Peter Z.)
> >   - added comments (by Peter Z.)
> >   - fixed the vma_pfn flag setting (by Hugh D.)
> > 
> 
> 
> > Suggested-by: Jann Horn <jannh@...gle.com>
> > Signed-off-by: Roman Gushchin <roman.gushchin@...ux.dev>
> 
> Link: some email discussion url lore.kernel.org..

It was based on some non-public discussion unfortunately, so no lore link.

Thank you!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ