From: Michael Ellerman <patch-notifications@ellerman.id.au>
To: Breno Leitao <leitao@debian.org>, linuxppc-dev@lists.ozlabs.org
Cc: Breno Leitao <leitao@debian.org>, gustavo@embeddedor.com
Subject: Re: [V2] powerpc/ptrace: Mitigate potential Spectre v1
Date: Sat, 9 Feb 2019 00:02:40 +1100 (AEDT) [thread overview]
Message-ID: <43wwMN58wQz9sNj@ozlabs.org> (raw)
In-Reply-To: <1548852360-29886-1-git-send-email-leitao@debian.org>
On Wed, 2019-01-30 at 12:46:00 UTC, Breno Leitao wrote:
> 'regno' is directly controlled by user space, hence leading to a potential
> exploitation of the Spectre variant 1 vulnerability.
>
> On PTRACE_SETREGS and PTRACE_GETREGS requests, user space passes the
> register number that would be read or written. This register number is
> called 'regno' which is part of the 'addr' syscall parameter.
>
> This 'regno' value is checked against the maximum pt_regs structure size,
> and then used to dereference it, which matches the initial part of a
> Spectre v1 (and Spectre v1.1) attack. The dereferenced value, then,
> is returned to userspace in the GETREGS case.
>
> This patch sanitizes 'regno' before using it to dereference pt_reg.
>
> Notice that given that speculation windows are large, the policy is
> to kill the speculation on the first load and not worry if it can be
> completed with a dependent load/store [1].
>
> [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2
>
> Signed-off-by: Breno Leitao <leitao@debian.org>
> Acked-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/ebb0e13ead2ddc186a80b1b0235deeef
cheers
prev parent reply other threads:[~2019-02-08 14:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-30 12:46 [PATCH V2] powerpc/ptrace: Mitigate potential Spectre v1 Breno Leitao
2019-01-30 15:55 ` Gustavo A. R. Silva
2019-02-08 13:02 ` Michael Ellerman [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=43wwMN58wQz9sNj@ozlabs.org \
--to=patch-notifications@ellerman.id.au \
--cc=gustavo@embeddedor.com \
--cc=leitao@debian.org \
--cc=linuxppc-dev@lists.ozlabs.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;
as well as URLs for NNTP newsgroup(s).