All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
Cc: akpm@linux-foundation.org, will@kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org
Subject: Re: [PATCH v3 0/9] Fixup page directory freeing
Date: Tue, 14 Jan 2020 11:50:02 +0100	[thread overview]
Message-ID: <20200114105002.GD2844@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20200114100145.365527-1-aneesh.kumar@linux.ibm.com>

On Tue, Jan 14, 2020 at 03:31:36PM +0530, Aneesh Kumar K.V wrote:
> This is a repost of patch series from Peter with the arch specific changes except ppc64 dropped.
> ppc64 changes are added here because we are redoing the patch series on top of ppc64 changes. This makes it
> easy to backport these changes. Only the first 3 patches need to be backported to stable. 
> 
> The thing is, on anything SMP, freeing page directories should observe the
> exact same order as normal page freeing:
> 
>  1) unhook page/directory
>  2) TLB invalidate
>  3) free page/directory
> 
> Without this, any concurrent page-table walk could end up with a Use-after-Free.
> This is esp. trivial for anything that has software page-table walkers
> (HAVE_FAST_GUP / software TLB fill) or the hardware caches partial page-walks
> (ie. caches page directories).
> 
> Even on UP this might give issues since mmu_gather is preemptible these days.
> An interrupt or preempted task accessing user pages might stumble into the free
> page if the hardware caches page directories.
> 
> This patch series fixup ppc64 and add generic MMU_GATHER changes to support the conversion of other architectures.
> I haven't added patches w.r.t other architecture because they are yet to be acked.

Obviously looks good to me; will you route this through the Power tree
since you're in a hurry to see this fixed?

  parent reply	other threads:[~2020-01-14 10:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-14 10:01 [PATCH v3 0/9] Fixup page directory freeing Aneesh Kumar K.V
2020-01-14 10:01 ` [PATCH v3 1/9] powerpc/mmu_gather: Enable RCU_TABLE_FREE even for !SMP case Aneesh Kumar K.V
2020-01-14 10:01   ` Aneesh Kumar K.V
2020-01-14 10:01 ` [PATCH v3 2/9] mm/mmu_gather: Invalidate TLB correctly on batch allocation failure and flush Aneesh Kumar K.V
2020-01-14 10:01 ` [PATCH v3 3/9] asm-generic/tlb: Avoid potential double flush Aneesh Kumar K.V
2020-01-14 10:01   ` Aneesh Kumar K.V
2020-01-14 10:01 ` [PATCH v3 4/9] asm-gemeric/tlb: Remove stray function declarations Aneesh Kumar K.V
2020-01-14 10:01 ` [PATCH v3 5/9] asm-generic/tlb: Add missing CONFIG symbol Aneesh Kumar K.V
2020-01-14 10:01   ` Aneesh Kumar K.V
2020-01-14 10:01 ` [PATCH v3 6/9] asm-generic/tlb: Rename HAVE_RCU_TABLE_FREE Aneesh Kumar K.V
2020-01-14 10:01 ` [PATCH v3 7/9] asm-generic/tlb: Rename HAVE_MMU_GATHER_PAGE_SIZE Aneesh Kumar K.V
2020-01-14 10:01 ` [PATCH v3 8/9] asm-generic/tlb: Rename HAVE_MMU_GATHER_NO_GATHER Aneesh Kumar K.V
2020-01-14 10:01 ` [PATCH v3 9/9] asm-generic/tlb: Provide MMU_GATHER_TABLE_FREE Aneesh Kumar K.V
2020-01-14 10:50 ` Peter Zijlstra [this message]
2020-01-14 12:28   ` [PATCH v3 0/9] Fixup page directory freeing Aneesh Kumar K.V
2020-01-15  0:25 ` Andrew Morton
2020-01-15 14:47   ` Aneesh Kumar K.V

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200114105002.GD2844@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.