{Dangerous Content?} Same problem for 4.14.y and a concern: Re: [PATCH 4.19 056/191] powerpc: select ARCH_WANT_IRQS_OFF_ACTIVATE_MM

From: Kamal Mostafa
Date: Tue Nov 17 2020 - 14:17:51 EST


Warning: This message has had one or more attachments removed
Warning: (not named).
Warning: Please read the "rtspam-uits-indiana-edu-Attachment-Warning.txt" attachment(s) for more information.

On Tue, Nov 3, 2020 at 4:22 PM Michael Ellerman <mpe@xxxxxxxxxxxxxx> wrote:

> Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> writes:
> > From: Nicholas Piggin <npiggin@xxxxxxxxx>
> >
> > [ Upstream commit 66acd46080bd9e5ad2be4b0eb1d498d5145d058e ]
> >
> > powerpc uses IPIs in some situations to switch a kernel thread away
> > from a lazy tlb mm, which is subject to the TLB flushing race
> > described in the changelog introducing ARCH_WANT_IRQS_OFF_ACTIVATE_MM.
> >
> > Signed-off-by: Nicholas Piggin <npiggin@xxxxxxxxx>
> > Signed-off-by: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
> > Link:
> https://lore.kernel.org/r/20200914045219.3736466-3-npiggin@xxxxxxxxx
> > Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
> > ---
> > arch/powerpc/Kconfig | 1 +
> > arch/powerpc/include/asm/mmu_context.h | 2 +-
> > 2 files changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> > index f38d153d25861..0bc53f0e37c0f 100644
> > --- a/arch/powerpc/Kconfig
> > +++ b/arch/powerpc/Kconfig
> > @@ -152,6 +152,7 @@ config PPC
> > select ARCH_USE_BUILTIN_BSWAP
> > select ARCH_USE_CMPXCHG_LOCKREF if PPC64
> > select ARCH_WANT_IPC_PARSE_VERSION
> > + select ARCH_WANT_IRQS_OFF_ACTIVATE_MM
>
> This depends on upstream commit:
>
> d53c3dfb23c4 ("mm: fix exec activate_mm vs TLB shootdown and lazy tlb
> switching race")
>
>
> Which I don't see in 4.19 stable, or in the email thread here.
>
> So this shouldn't be backported to 4.19 unless that commit is also
> backported.
>
> cheers
>

Hi-

This glitch has made its way into 4.14.y ...
[4.14.y] c2bca8712a19 powerpc: select ARCH_WANT_IRQS_OFF_ACTIVATE_MM
But 4.14.y does not carry the prereq that introduces that config.

That said, I have a more general concern about the new config (in mainline
and the stable backports):
[mainline] d53c3dfb23c4 mm: fix exec activate_mm vs TLB shootdown and
lazy tlb switching race
It would seem that the intent is that it should be *only* enabled
(currently at least) for arches that will explicitly select it, but the
config advice does not make that very clear. Could that new config get an
explicit "default n" line?

-Kamal
This is a message from the MailScanner E-Mail Virus Protection Service
----------------------------------------------------------------------
The original e-mail attachment "not named"
was believed to be infected by a virus and has been replaced by this warning
message.

If you wish to receive a copy of the *infected* attachment, please
e-mail helpdesk and include the whole of this message
in your request. Alternatively, you can call them, with
the contents of this message to hand when you call.

At Tue Nov 17 14:17:51 2020 the virus scanner said:
External message bodies cannot be scanned and are removed

Note to Help Desk: Look on the rtspam-uits-indiana-edu (rt-spam) MailScanner in /var/spool/MailScanner/quarantine/20201117 (message 91CB42A4001.A1BDB).
--
Postmaster
RT-Spam Mail Scanner
rt-spam.uits.indiana.edu

For all your IT requirements visit: http://www.transtec.co.uk