From: Jonathan Morton <chromatix99@gmail.com>
To: Dave Taht <dave.taht@gmail.com>
Cc: "dpreed@deepplum.com" <dpreed@deepplum.com>,
"Joel Wirāmu Pauling" <joel@aenertia.net>,
cerowrt-devel@lists.bufferbloat.net
Subject: Re: [Cerowrt-devel] Spectre and EBPF JIT
Date: Fri, 5 Jan 2018 16:07:03 +0200 [thread overview]
Message-ID: <EEA16134-72C4-4A35-ACB1-0F6FB29B2718@gmail.com> (raw)
In-Reply-To: <CAA93jw5zzkFGusTvjG++WO71q8NMN0mmVsx2Q+SWh2LKEbuLUQ@mail.gmail.com>
> On 5 Jan, 2018, at 6:53 am, Dave Taht <dave.taht@gmail.com> wrote:
>
> It took me a long while to digest that one. The branch predictor
> analysis of haswell was easiest to understand (and AMD claims to have
> an AI based one), and perhaps scrambling that at random intervals
> would help? (this stuff is now way above my pay grade)
Software mitigations for all three attacks have been developed during the "responsible disclosure" period.
Spectre v1: adding an LFENCE instruction (memory load fence) to JIT code performing a bounds-checked array read. This is basically a userspace fix for a userspace attack. Firefox just got this, Chrome undoubtedly will too, if it hasn't already.
Spectre v2: three different mitigations are appropriate for different families of CPU:
https://lkml.org/lkml/2018/1/4/742
On AMD CPUs, the small risk actually existing (because AMD's BTB is much less prone to poisoning than Intel's) is erased by adding LFENCE to privileged indirect branches. This has only a very small cost.
On Intel CPUs until Broadwell inclusive (and Silvermont onwards), a "retpoline" structure is necessary and sufficient. This has a bigger cost than LFENCE and is pretty ugly to look at, but it's still relatively minor.
On Skylake, Kaby Lake and Coffee Lake, something more exotic is required - I think it involves temporarily disabling the BTB during privileged indirect branches. That's *really* ugly, and involves tweaking poorly-documented MSRs.
Something similar in nature to the above should also work for affected ARM cores.
Meltdown: nothing is required for AMD CPUs. Unmapping the privileged addresses when returning to userspace is sufficient for Intel, but incurs a big performance overhead for syscalls. The same is likely true for any other affected CPUs.
- Jonathan Morton
next prev parent reply other threads:[~2018-01-05 14:07 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-01 23:08 [Cerowrt-devel] KASLR: Do we have to worry about other arches than x86? Dave Taht
[not found] ` <CAJq5cE23bbiPE0a_9zd1VLnO7=c7bjmwwxVwaD2=to3fg5TOjA@mail.gmail.com>
2018-01-01 23:27 ` Jonathan Morton
2018-01-02 19:06 ` Jonathan Morton
2018-01-04 12:09 ` Jonathan Morton
2018-01-04 13:38 ` Dave Taht
2018-01-04 13:48 ` Jonathan Morton
2018-01-04 13:59 ` Dave Taht
2018-01-04 14:49 ` Jonathan Morton
2018-01-04 14:53 ` Dave Taht
2018-01-04 20:28 ` dpreed
2018-01-04 21:20 ` Jonathan Morton
2018-01-04 21:40 ` Dave Taht
2018-01-04 21:51 ` valdis.kletnieks
2018-01-04 21:44 ` Joel Wirāmu Pauling
2018-01-04 21:47 ` Dave Taht
2018-01-04 21:52 ` Joel Wirāmu Pauling
2018-01-04 21:54 ` Dave Taht
2018-01-04 21:57 ` Joel Wirāmu Pauling
[not found] ` <1515103187.670416570@apps.rackspace.com>
2018-01-04 22:02 ` Joel Wirāmu Pauling
[not found] ` <1515103048.715224709@apps.rackspace.com>
2018-01-04 22:00 ` Joel Wirāmu Pauling
2018-01-04 22:09 ` dpreed
2018-01-04 22:13 ` Joel Wirāmu Pauling
2018-01-04 22:15 ` Dave Taht
2018-01-04 22:26 ` Jonathan Morton
2018-01-04 22:35 ` Joel Wirāmu Pauling
2018-01-04 22:58 ` [Cerowrt-devel] Spectre and EBPF JIT dpreed
2018-01-05 4:53 ` Dave Taht
2018-01-05 14:07 ` Jonathan Morton [this message]
2018-01-05 15:35 ` dpreed
2018-01-05 19:18 ` Jonathan Morton
2018-01-05 20:15 ` David Lang
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
List information: https://lists.bufferbloat.net/postorius/lists/cerowrt-devel.lists.bufferbloat.net/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=EEA16134-72C4-4A35-ACB1-0F6FB29B2718@gmail.com \
--to=chromatix99@gmail.com \
--cc=cerowrt-devel@lists.bufferbloat.net \
--cc=dave.taht@gmail.com \
--cc=dpreed@deepplum.com \
--cc=joel@aenertia.net \
/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