Gentoo Archives: gentoo-user

From: Martin Vaeth <martin@×××××.de>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: Spectre-NG
Date: Tue, 08 May 2018 08:22:23
Message-Id: slrnpf2nhc.hbt.martin@clover.invalid
In Reply to: Re: [gentoo-user] Spectre-NG by Rich Freeman
1 Rich Freeman <rich0@g.o> wrote:
2 >
3 > Higher-level languages will probably become nearly immune to Spectre just
4 > as most are nearly immune to buffer overflows.
5
6 Quite the opposite: Higher-level languages *always* do some checks
7 for array-length etc, and it is the _checks_ which are vulnerable.
8 You can only make them non-vulnerable by making them horribly slow
9 (by omitting speculative execution completely for the corresponding
10 conditionals).
11
12 The same omission could also be arranged automatically for _every_
13 C-code (security at the price of a hugh speed cost). I still do
14 not understand why such an option is not yet implemented in gcc:
15 AFAIK, none of the current options -mindirect-branch*
16 -mfunction-return* -fcf-protection=full (though I am not
17 completely sure about the latter) would protect you automatically
18 against speculative exection for bound-checking conditional tests.
19 I am aware that this would cost a lot of speed,
20 but for certain systems/applications this might be worth.

Replies

Subject Author
Re: [gentoo-user] Re: Spectre-NG Rich Freeman <rich0@g.o>