From: Sasha Levin <sashal@kernel.org>
To: gregkh@linuxfoundation.org
Cc: heiko.carstens@de.ibm.com, gor@linux.ibm.com, stable@vger.kernel.org
Subject: Re: FAILED: patch "[PATCH] s390/smp,vdso: fix ASCE handling" failed to apply to 4.19-stable tree
Date: Mon, 16 Dec 2019 11:24:19 -0500 [thread overview]
Message-ID: <20191216162419.GG17708@sasha-vm> (raw)
In-Reply-To: <157650182321140@kroah.com>
On Mon, Dec 16, 2019 at 02:10:23PM +0100, gregkh@linuxfoundation.org wrote:
>
>The patch below does not apply to the 4.19-stable tree.
>If someone wants it applied there, or to any other stable or longterm
>tree, then please email the backport, including the original git commit
>id to <stable@vger.kernel.org>.
>
>thanks,
>
>greg k-h
>
>------------------ original commit in Linus's tree ------------------
>
>From a2308c11ecbc3471ebb7435ee8075815b1502ef0 Mon Sep 17 00:00:00 2001
>From: Heiko Carstens <heiko.carstens@de.ibm.com>
>Date: Mon, 18 Nov 2019 13:09:52 +0100
>Subject: [PATCH] s390/smp,vdso: fix ASCE handling
>
>When a secondary CPU is brought up it must initialize its control
>registers. CPU A which triggers that a secondary CPU B is brought up
>stores its control register contents into the lowcore of new CPU B,
>which then loads these values on startup.
>
>This is problematic in various ways: the control register which
>contains the home space ASCE will correctly contain the kernel ASCE;
>however control registers for primary and secondary ASCEs are
>initialized with whatever values were present in CPU A.
>
>Typically:
>- the primary ASCE will contain the user process ASCE of the process
> that triggered onlining of CPU B.
>- the secondary ASCE will contain the percpu VDSO ASCE of CPU A.
>
>Due to lazy ASCE handling we may also end up with other combinations.
>
>When then CPU B switches to a different process (!= idle) it will
>fixup the primary ASCE. However the problem is that the (wrong) ASCE
>from CPU A was loaded into control register 1: as soon as an ASCE is
>attached (aka loaded) a CPU is free to generate TLB entries using that
>address space.
>Even though it is very unlikey that CPU B will actually generate such
>entries, this could result in TLB entries of the address space of the
>process that ran on CPU A. These entries shouldn't exist at all and
>could cause problems later on.
>
>Furthermore the secondary ASCE of CPU B will not be updated correctly.
>This means that processes may see wrong results or even crash if they
>access VDSO data on CPU B. The correct VDSO ASCE will eventually be
>loaded on return to user space as soon as the kernel executed a call
>to strnlen_user or an atomic futex operation on CPU B.
>
>Fix both issues by intializing the to be loaded control register
>contents with the correct ASCEs and also enforce (re-)loading of the
>ASCEs upon first context switch and return to user space.
>
>Fixes: 0aaba41b58bc ("s390: remove all code using the access register mode")
>Cc: stable@vger.kernel.org # v4.15+
>Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
>Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Adjusted context for missing ce3dc447493f ("s390: add support for
virtually mapped kernel stacks") in 4.19 and queued up.
--
Thanks,
Sasha
prev parent reply other threads:[~2019-12-16 16:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-16 13:10 FAILED: patch "[PATCH] s390/smp,vdso: fix ASCE handling" failed to apply to 4.19-stable tree gregkh
2019-12-16 16:24 ` Sasha Levin [this message]
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=20191216162419.GG17708@sasha-vm \
--to=sashal@kernel.org \
--cc=gor@linux.ibm.com \
--cc=gregkh@linuxfoundation.org \
--cc=heiko.carstens@de.ibm.com \
--cc=stable@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox