1 |
On Thu, May 10, 2018 at 1:34 AM Martin Vaeth <martin@×××××.de> wrote: |
2 |
|
3 |
> As a simple example, assume that you have read a password file |
4 |
> into a string of your language and now access a single password. |
5 |
> No matter, how you mark the end of the password (fixed-length, \0, \n, |
6 |
> ...) speculative execution might always access the next password(s) |
7 |
> unless you prevent it globally. Whether it is exploitable depends |
8 |
> of course on other things. There is no difference to C. |
9 |
|
10 |
|
11 |
I'll just reply to this because the rest of the email is just a natural |
12 |
consequence of it. |
13 |
|
14 |
I will confess up-front I'm not an expert in Spectre, but I don't see how |
15 |
having the next password speculatively read would on its own create a |
16 |
vulnerability. You would also need some kind of indirect memory access |
17 |
based on the speculatively-accessed data to create a timing channel. |
18 |
|
19 |
And of course it is entirely possible that the loop wouldn't be |
20 |
sequentially reading in data in a way that could cause a bound to be |
21 |
exceeded, and in this situation I don't see why protection would be |
22 |
required. Consider: |
23 |
|
24 |
for x = 1 to 10 : y=5+3 : next x |
25 |
|
26 |
This is obviously trivial, but I don't see how executing that loop a few |
27 |
too many times would cause problems, so blocking speculation is just going |
28 |
to hurt performance for no benefit. |
29 |
|
30 |
I still tend to think that the additional context around these memory |
31 |
accesses that is available in a high-level language could be used by a |
32 |
compiler to determine when protection is required. |
33 |
|
34 |
Certainly a skilled programmer might be able to do an even better job if |
35 |
they were vigilant, but not all programmers are equally skilled... |
36 |
|
37 |
-- |
38 |
Rich |