Gentoo Archives: gentoo-user

From: Nikos Chantziaras <realnc@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: gcc 7.3 + kernel 4.15 = spectre_v2 fixed
Date: Wed, 31 Jan 2018 12:07:12
Message-Id: p4sbci$st2$1@blaine.gmane.org
In Reply to: [gentoo-user] Re: gcc 7.3 + kernel 4.15 = spectre_v2 fixed by Martin Vaeth
1 On 31/01/18 13:17, Martin Vaeth wrote:
2 > Nikos Chantziaras <realnc@×××××.com> wrote:
3 >>
4 >> Well, if you're running a local process that is trying to attack you,
5 >> you've been compromised already, imo.
6 >
7 > By your definition, you are compromised if you surf to the
8 > wrong webpage with enabled javascript.
9
10 That's not what was said.
11
12 What was said is that software that executes untrusted code inside a
13 trusted container is affected. You trust the container mechanism, you
14 don't trust the code executing inside of it. So the container needs to
15 be protected.
16
17 For example, if you don't trust Firefox, don't install Firefox. But you
18 *do* trust Firefox. What you don't trust is the JS code Firefox is
19 executing. So Firefox needs protection.
20
21
22 > You misunderstand: For the packages which run the code, the mitigations
23 > like retpoline do not help much. It is the packages which _somehow_
24 > react (or can be called) by such a code which need the protection by
25 > retpoline built-in.
26 > And this is an awful lot of packages since it includes also all libraries
27 > which are possibly used by these packages, language interpreters used by
28 > these packages, etc. If in doubt, I would re-emerge the
29 > full -e @world with corresponding compiler switches enabled.
30
31 I was under the impression that it's the function that performs the call
32 that needs protection. The called function doesn't need protection,
33 because if it ends up being actually called, then it's too late already.
34
35 For example, if sandboxed, untrusted code wants to speculatively execute
36 a memcpy(), then the sandbox would need to call it on behalf of the
37 untrusted code. But if the sandbox is protected, the memcpy() call would
38 never be made speculatively, since retpoline will trap it. So memcpy()
39 itself doesn't need protection. If memcpy() ends up being called, then
40 it's too late. Protecting memcpy() doesn't do anything to prevent
41 memcpy() from being called, as it's been called already.
42
43 What am I missing here? :-P

Replies