Re: [PATCH v2 1/4] mm: fix exec activate_mm vs TLB shootdown and lazy tlb switching race

2020-09-18 Thread Michael Ellerman
Nicholas Piggin writes: > Excerpts from pet...@infradead.org's message of September 14, 2020 8:56 pm: >> On Mon, Sep 14, 2020 at 02:52:16PM +1000, Nicholas Piggin wrote: >>> Reading and modifying current->mm and current->active_mm and switching >>> mm should be done with irqs off, to prevent

Re: [PATCH v2 1/4] mm: fix exec activate_mm vs TLB shootdown and lazy tlb switching race

2020-09-15 Thread Michael Ellerman
Nicholas Piggin writes: > Excerpts from pet...@infradead.org's message of September 14, 2020 8:56 pm: >> On Mon, Sep 14, 2020 at 02:52:16PM +1000, Nicholas Piggin wrote: >>> Reading and modifying current->mm and current->active_mm and switching >>> mm should be done with irqs off, to prevent

Re: [PATCH v2 1/4] mm: fix exec activate_mm vs TLB shootdown and lazy tlb switching race

2020-09-14 Thread Nicholas Piggin
Excerpts from pet...@infradead.org's message of September 14, 2020 8:56 pm: > On Mon, Sep 14, 2020 at 02:52:16PM +1000, Nicholas Piggin wrote: >> Reading and modifying current->mm and current->active_mm and switching >> mm should be done with irqs off, to prevent races seeing an intermediate >>

Re: [PATCH v2 1/4] mm: fix exec activate_mm vs TLB shootdown and lazy tlb switching race

2020-09-14 Thread peterz
On Mon, Sep 14, 2020 at 02:52:16PM +1000, Nicholas Piggin wrote: > Reading and modifying current->mm and current->active_mm and switching > mm should be done with irqs off, to prevent races seeing an intermediate > state. > > This is similar to commit 38cf307c1f20 ("mm: fix kthread_use_mm() vs

[PATCH v2 1/4] mm: fix exec activate_mm vs TLB shootdown and lazy tlb switching race

2020-09-13 Thread Nicholas Piggin
Reading and modifying current->mm and current->active_mm and switching mm should be done with irqs off, to prevent races seeing an intermediate state. This is similar to commit 38cf307c1f20 ("mm: fix kthread_use_mm() vs TLB invalidate"). At exec-time when the new mm is activated, the old one