From: Greg KH <gregkh@linuxfoundation.org>
To: KP Singh <kpsingh@kernel.org>
Cc: security@kernel.org, pjt@google.com, evn@google.com,
jpoimboe@kernel.org, tglx@linutronix.de, mingo@redhat.com,
bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org,
hpa@zytor.com, peterz@infradead.org,
pawan.kumar.gupta@linux.intel.com, kim.phillips@amd.com,
alexandre.chartre@oracle.com, daniel.sneddon@linux.intel.com,
"José Oliveira" <joseloliveira11@gmail.com>,
"Rodrigo Branco" <rodrigo@kernelhacking.com>,
"Alexandra Sandulescu" <aesa@google.com>,
"Jim Mattson" <jmattson@google.com>,
stable@vger.kernel.org
Subject: Re: [PATCH] x86/speculation: Fix user-mode spectre-v2 protection with KERNEL_IBRS
Date: Mon, 20 Feb 2023 11:52:27 +0100 [thread overview]
Message-ID: <Y/NQ6w4UlEuBSTql@kroah.com> (raw)
In-Reply-To: <20230220103930.1963742-1-kpsingh@kernel.org>
On Mon, Feb 20, 2023 at 11:39:30AM +0100, KP Singh wrote:
> With the introduction of KERNEL_IBRS, STIBP is no longer needed
> to prevent cross thread training in the kernel space. When KERNEL_IBRS
> was added, it also disabled the user-mode protections for spectre_v2.
> KERNEL_IBRS does not mitigate cross thread training in the userspace.
>
> In order to demonstrate the issue, one needs to avoid syscalls in the
> victim as syscalls can shorten the window size due to
> a user -> kernel -> user transition which sets the
> IBRS bit when entering kernel space and clearing any training the
> attacker may have done.
>
> Allow users to select a spectre_v2_user mitigation (STIBP always on,
> opt-in via prctl) when KERNEL_IBRS is enabled.
>
> Reported-by: José Oliveira <joseloliveira11@gmail.com>
> Reported-by: Rodrigo Branco <rodrigo@kernelhacking.com>
> Reviewed-by: Alexandra Sandulescu <aesa@google.com>
> Reviewed-by: Jim Mattson <jmattson@google.com>
> Fixes: 7c693f54c873 ("x86/speculation: Add spectre_v2=ibrs option to support Kernel IBRS")
> Cc: stable@vger.kernel.org
> Signed-off-by: KP Singh <kpsingh@kernel.org>
> ---
> arch/x86/kernel/cpu/bugs.c | 25 +++++++++++++++++--------
> 1 file changed, 17 insertions(+), 8 deletions(-)
As this is posted publicly, there's no need to send it to
security@kernel.org, it doesn't need to be involved.
thanks,
greg k-h
next prev parent reply other threads:[~2023-02-20 10:58 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-20 10:39 [PATCH] x86/speculation: Fix user-mode spectre-v2 protection with KERNEL_IBRS KP Singh
2023-02-20 10:52 ` Greg KH [this message]
2023-02-20 11:11 ` KP Singh
2023-02-20 11:20 ` Greg KH
2023-02-20 11:25 ` KP Singh
2023-02-20 11:25 ` KP Singh
2023-02-20 11:38 ` Greg KH
2023-02-20 11:48 ` KP Singh
2023-02-20 13:59 ` Borislav Petkov
2023-02-20 11:38 ` Josh Poimboeuf
2023-02-20 11:49 ` KP Singh
2023-02-20 12:07 ` Josh Poimboeuf
2023-02-20 12:11 ` Josh Poimboeuf
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=Y/NQ6w4UlEuBSTql@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=aesa@google.com \
--cc=alexandre.chartre@oracle.com \
--cc=bp@alien8.de \
--cc=daniel.sneddon@linux.intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=evn@google.com \
--cc=hpa@zytor.com \
--cc=jmattson@google.com \
--cc=joseloliveira11@gmail.com \
--cc=jpoimboe@kernel.org \
--cc=kim.phillips@amd.com \
--cc=kpsingh@kernel.org \
--cc=mingo@redhat.com \
--cc=pawan.kumar.gupta@linux.intel.com \
--cc=peterz@infradead.org \
--cc=pjt@google.com \
--cc=rodrigo@kernelhacking.com \
--cc=security@kernel.org \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=x86@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