Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"I prefer the blunted cudgels of the followers of the Serpent God." -- Sean Doran the Younger


devel / comp.arch / Re: Memory encryption (was: Spectre)

SubjectAuthor
* Why separate 32-bit arithmetic on a 64-bit architecture?Thomas Koenig
+* Re: Why separate 32-bit arithmetic on a 64-bit architecture?BGB
|`* Re: Why separate 32-bit arithmetic on a 64-bit architecture?David Brown
| +- Re: Why separate 32-bit arithmetic on a 64-bit architecture?BGB
| `* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Anton Ertl
|  `- Re: Why separate 32-bit arithmetic on a 64-bit architecture?Anton Ertl
+* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Anton Ertl
|`- Re: Why separate 32-bit arithmetic on a 64-bit architecture?BGB
+* Re: Why separate 32-bit arithmetic on a 64-bit architecture?MitchAlsup
|`* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Marcus
| +- Re: Why separate 32-bit arithmetic on a 64-bit architecture?Marcus
| `- Re: Why separate 32-bit arithmetic on a 64-bit architecture?MitchAlsup
+* Re: Why separate 32-bit arithmetic on a 64-bit architecture?EricP
|+* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Thomas Koenig
||`* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Thomas Koenig
|| `* Re: Why separate 32-bit arithmetic on a 64-bit architecture?EricP
||  `* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Thomas Koenig
||   `* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Quadibloc
||    +* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Terje Mathisen
||    |`* The cost of gradual underflow (was: Why separate 32-bit arithmetic on a 64-bit aStefan Monnier
||    | `- Re: The cost of gradual underflowTerje Mathisen
||    +- Re: Why separate 32-bit arithmetic on a 64-bit architecture?MitchAlsup
||    `* Re: Why separate 32-bit arithmetic on a 64-bit architecture?antispam
||     +* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Terje Mathisen
||     |`* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Michael S
||     | +* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Terje Mathisen
||     | |`* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Michael S
||     | | +* Re: Why separate 32-bit arithmetic on a 64-bit architecture?MitchAlsup
||     | | |`* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Michael S
||     | | | `* Re: Why separate 32-bit arithmetic on a 64-bit architecture?MitchAlsup
||     | | |  `* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Michael S
||     | | |   +- Re: Why separate 32-bit arithmetic on a 64-bit architecture?MitchAlsup
||     | | |   `- Re: Why separate 32-bit arithmetic on a 64-bit architecture?Anton Ertl
||     | | `* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Terje Mathisen
||     | |  `* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Michael S
||     | |   `* Re: Why separate 32-bit arithmetic on a 64-bit architecture?MitchAlsup
||     | |    `* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Michael S
||     | |     `* Re: Why separate 32-bit arithmetic on a 64-bit architecture?MitchAlsup
||     | |      `* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Michael S
||     | |       `* Re: Why separate 32-bit arithmetic on a 64-bit architecture?MitchAlsup
||     | |        `* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Michael S
||     | |         +* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Thomas Koenig
||     | |         |+- Re: Why separate 32-bit arithmetic on a 64-bit architecture?Quadibloc
||     | |         |`- Re: Why separate 32-bit arithmetic on a 64-bit architecture?Quadibloc
||     | |         `- Re: Why separate 32-bit arithmetic on a 64-bit architecture?Terje Mathisen
||     | `* Re: Why separate 32-bit arithmetic on a 64-bit architecture?MitchAlsup
||     |  +* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Quadibloc
||     |  |+* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Quadibloc
||     |  ||`- Re: Why separate 32-bit arithmetic on a 64-bit architecture?MitchAlsup
||     |  |+* Re: Why separate 32-bit arithmetic on a 64-bit architecture?MitchAlsup
||     |  ||`* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Quadibloc
||     |  || `* Re: Why separate 32-bit arithmetic on a 64-bit architecture?MitchAlsup
||     |  ||  `* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Quadibloc
||     |  ||   +* Re: Why separate 32-bit arithmetic on a 64-bit architecture?MitchAlsup
||     |  ||   |`* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Thomas Koenig
||     |  ||   | `* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Michael S
||     |  ||   |  +* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Anton Ertl
||     |  ||   |  |+- Re: Why separate 32-bit arithmetic on a 64-bit architecture?EricP
||     |  ||   |  |`* Re: Why separate 32-bit arithmetic on a 64-bit architecture?MitchAlsup
||     |  ||   |  | `- Re: Why separate 32-bit arithmetic on a 64-bit architecture?Michael S
||     |  ||   |  `* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Quadibloc
||     |  ||   |   +- Re: Why separate 32-bit arithmetic on a 64-bit architecture?Michael S
||     |  ||   |   +* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Quadibloc
||     |  ||   |   |`* Re: Why separate 32-bit arithmetic on a 64-bit architecture?George Neuner
||     |  ||   |   | `- Re: Why separate 32-bit arithmetic on a 64-bit architecture?Quadibloc
||     |  ||   |   `* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Quadibloc
||     |  ||   |    +- Re: Why separate 32-bit arithmetic on a 64-bit architecture?Quadibloc
||     |  ||   |    +- Spectre ane EPIC (was: Why separate 32-bit arithmetic...)Anton Ertl
||     |  ||   |    +* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Michael S
||     |  ||   |    |`* Spectre (was: Why separate 32-bit arithmetic ...)Anton Ertl
||     |  ||   |    | +* Re: Spectre (was: Why separate 32-bit arithmetic ...)Michael S
||     |  ||   |    | |+* Re: SpectreEricP
||     |  ||   |    | ||+* Re: SpectreMitchAlsup
||     |  ||   |    | |||`* Re: SpectreEricP
||     |  ||   |    | ||| `- Re: SpectreMitchAlsup
||     |  ||   |    | ||`- Re: SpectreAnton Ertl
||     |  ||   |    | |`* Re: Spectre (was: Why separate 32-bit arithmetic ...)Anton Ertl
||     |  ||   |    | | +* Re: Spectre (was: Why separate 32-bit arithmetic ...)MitchAlsup
||     |  ||   |    | | |`- Re: Spectre (was: Why separate 32-bit arithmetic ...)Thomas Koenig
||     |  ||   |    | | `- Re: Spectre (was: Why separate 32-bit arithmetic ...)Anton Ertl
||     |  ||   |    | +* Re: SpectreEricP
||     |  ||   |    | |`* Re: SpectreAnton Ertl
||     |  ||   |    | | +* Memory encryption (was: Spectre)Thomas Koenig
||     |  ||   |    | | |`* Re: Memory encryption (was: Spectre)Anton Ertl
||     |  ||   |    | | | `* Re: Memory encryption (was: Spectre)Elijah Stone
||     |  ||   |    | | |  +- Re: Memory encryption (was: Spectre)Michael S
||     |  ||   |    | | |  `* Re: Memory encryption (was: Spectre)Anton Ertl
||     |  ||   |    | | |   +- Re: Memory encryption (was: Spectre)MitchAlsup
||     |  ||   |    | | |   `* Re: Memory encryption (was: Spectre)Thomas Koenig
||     |  ||   |    | | |    `- Re: Memory encryption (was: Spectre)Anton Ertl
||     |  ||   |    | | `* Re: SpectreTerje Mathisen
||     |  ||   |    | |  `* Re: SpectreThomas Koenig
||     |  ||   |    | |   +* Re: SpectreAnton Ertl
||     |  ||   |    | |   |`* Re: SpectreThomas Koenig
||     |  ||   |    | |   | +- Re: SpectreAnton Ertl
||     |  ||   |    | |   | `- Re: SpectreMichael S
||     |  ||   |    | |   `- Re: SpectreMitchAlsup
||     |  ||   |    | `* Re: Spectre (was: Why separate 32-bit arithmetic ...)MitchAlsup
||     |  ||   |    |  `- Re: Spectre (was: Why separate 32-bit arithmetic ...)Anton Ertl
||     |  ||   |    `* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Quadibloc
||     |  ||   |     `- Re: Why separate 32-bit arithmetic on a 64-bit architecture?Quadibloc
||     |  ||   `* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Anton Ertl
||     |  |+- Re: Why separate 32-bit arithmetic on a 64-bit architecture?Bill Findlay
||     |  |`* Re: Imprecision, was Why separate 32-bit arithmetic on a 64-bit architecture?John Levine
||     |  `- Re: Why separate 32-bit arithmetic on a 64-bit architecture?Michael S
||     `* Re: Why separate 32-bit arithmetic on a 64-bit architecture?MitchAlsup
|`* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Anton Ertl
`* Re: Why separate 32-bit arithmetic on a 64-bit architecture?Quadibloc

Pages:1234567
Re: Spectre

<2022Mar24.102035@mips.complang.tuwien.ac.at>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24440&group=comp.arch#24440

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.arch
Subject: Re: Spectre
Date: Thu, 24 Mar 2022 09:20:35 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 20
Message-ID: <2022Mar24.102035@mips.complang.tuwien.ac.at>
References: <82d668ec-a140-454c-8606-9e665c750997n@googlegroups.com> <memo.20220322141111.1928h@jgd.cix.co.uk> <2c5bd9b0-1439-49c1-a4c8-707f27a9eb11n@googlegroups.com> <2022Mar23.093749@mips.complang.tuwien.ac.at> <02d8578d-eb8e-463d-87de-e68a23952aa4n@googlegroups.com> <2cG_J.96741$dln7.46979@fx03.iad>
Injection-Info: reader02.eternal-september.org; posting-host="d5f67e5c06b5b0e3beeb5b798e22ec52";
logging-data="7611"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18nim7srwTyQmXLY/kmqbFl"
Cancel-Lock: sha1:iV7FG7+BveS8GU9aZMX65tVRD3M=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Thu, 24 Mar 2022 09:20 UTC

EricP <ThatWouldBeTelling@thevillage.com> writes:
>There has been a lot of research on *value* speculation though
>I don't think any has made it into the commercial market.
>For example, value speculation allows speculative forwarding
>of a store value to a subsequent load and then at load retire
>checks that the value was correct.

Zen3 has features controllable by chicken bits: "speculative store
bypass" and "predictive store forwarding"; We have discussed them in
the thread starting with <2021Apr10.132712@mips.complang.tuwien.ac.at>
(https://news.novabbs.com/computers/article-flat.php?id=16188&group=comp.arch#16188).

I have also seen a posting analysing Intel's patent on alias
prediction and how actual Intel CPUs perform (they implement pretty
accurately what was patented).

- anton
--
'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>

Memory encryption (was: Spectre)

<t1he8k$luk$1@newsreader4.netcologne.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24441&group=comp.arch#24441

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!news.freedyn.de!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd6-30bd-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoe...@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Memory encryption (was: Spectre)
Date: Thu, 24 Mar 2022 09:39:32 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <t1he8k$luk$1@newsreader4.netcologne.de>
References: <82d668ec-a140-454c-8606-9e665c750997n@googlegroups.com>
<memo.20220322141111.1928h@jgd.cix.co.uk>
<2c5bd9b0-1439-49c1-a4c8-707f27a9eb11n@googlegroups.com>
<2022Mar23.093749@mips.complang.tuwien.ac.at>
<%OF_J.126355$ZmJ7.99768@fx06.iad>
<2022Mar24.090722@mips.complang.tuwien.ac.at>
Injection-Date: Thu, 24 Mar 2022 09:39:32 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd6-30bd-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd6:30bd:0:7285:c2ff:fe6c:992d";
logging-data="22484"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Thu, 24 Mar 2022 09:39 UTC

Following this discussion, it seems that a great deal of thought
needs to go into avoiding Spectre, and people have not yet put
a Spectre-immune CPU on the market.

Could an alternative be memory encryption? IBM has it for zSystem,
but to be useful against spectre, it would have to be included
in the data path between the L1 cache and the rest of the CPU.
If one used AES, the minimum number of xors there is 11, so it
would probably add one cycle of latency.

Probably too expensive...

Re: Spectre (was: Why separate 32-bit arithmetic ...)

<2022Mar24.103422@mips.complang.tuwien.ac.at>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24443&group=comp.arch#24443

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.arch
Subject: Re: Spectre (was: Why separate 32-bit arithmetic ...)
Date: Thu, 24 Mar 2022 09:34:22 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 16
Message-ID: <2022Mar24.103422@mips.complang.tuwien.ac.at>
References: <82d668ec-a140-454c-8606-9e665c750997n@googlegroups.com> <memo.20220322141111.1928h@jgd.cix.co.uk> <2c5bd9b0-1439-49c1-a4c8-707f27a9eb11n@googlegroups.com> <2022Mar23.093749@mips.complang.tuwien.ac.at> <a24a8df0-2adc-4728-9c83-193d9e41f487n@googlegroups.com>
Injection-Info: reader02.eternal-september.org; posting-host="d5f67e5c06b5b0e3beeb5b798e22ec52";
logging-data="7611"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/mtoTlLRf91d9WEIUCHDkQ"
Cancel-Lock: sha1:J22JKNpTo4KmqnyiLJ1eLqm5XNY=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Thu, 24 Mar 2022 09:34 UTC

MitchAlsup <MitchAlsup@aol.com> writes:
>What is the world going to do is x86, ARM, and RISC-V all fail to have=20
>immunity from Spectr=C3=A9 ?

What they have done up to now: Mostly nothing; a few select pieces of
software are considered so relevant that they get Spectre mitigations,
but of course there is no way to know whether they caught everything
(and of course the rest of the software stack is still vulnerable);
and yet even these mitigations often cost more in performance than the
3% Michael S is unwilling to pay for Spectre-immune CPUs
<https://www.phoronix.com/scan.php?page=article&item=spectre-meltdown-2>.

- anton
--
'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>

Re: Memory encryption (was: Spectre)

<2022Mar24.110023@mips.complang.tuwien.ac.at>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24444&group=comp.arch#24444

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.arch
Subject: Re: Memory encryption (was: Spectre)
Date: Thu, 24 Mar 2022 10:00:23 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 27
Distribution: world
Message-ID: <2022Mar24.110023@mips.complang.tuwien.ac.at>
References: <82d668ec-a140-454c-8606-9e665c750997n@googlegroups.com> <memo.20220322141111.1928h@jgd.cix.co.uk> <2c5bd9b0-1439-49c1-a4c8-707f27a9eb11n@googlegroups.com> <2022Mar23.093749@mips.complang.tuwien.ac.at> <%OF_J.126355$ZmJ7.99768@fx06.iad> <2022Mar24.090722@mips.complang.tuwien.ac.at> <t1he8k$luk$1@newsreader4.netcologne.de>
Injection-Info: reader02.eternal-september.org; posting-host="d5f67e5c06b5b0e3beeb5b798e22ec52";
logging-data="7611"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/FxXHjjj+rthwP40tYwjbX"
Cancel-Lock: sha1:Q4sBoAQgC1oVMMDtzTAp8frgYro=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Thu, 24 Mar 2022 10:00 UTC

Thomas Koenig <tkoenig@netcologne.de> writes:
>Could an alternative be memory encryption?

No. In a Spectre attack the attacked process reads the memory
(speculatively), and it will decrypt it speculatively, and then side
channels are used to extract this information; in the first variants
the side channel was cache accesses, which revealed the address
accessed by the attacked process.

So you may be able to mitigate some kinds of attacks by encrypting the
address, but this won't help against attacks where the side channel
does not use addresses (but, e.g., the power state of the high half of
the AVX units).

>IBM has it for zSystem,
>but to be useful against spectre, it would have to be included
>in the data path between the L1 cache and the rest of the CPU.
>If one used AES, the minimum number of xors there is 11, so it
>would probably add one cycle of latency.

For encrypting L1 caches, it may be better to have some cheap
encryption with very frequent change of keys.

- anton
--
'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>

Re: Spectre

<t1hh19$1ht2$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24445&group=comp.arch#24445

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.mixmin.net!aioe.org!EhtdJS5E9ITDZpJm3Uerlg.user.46.165.242.91.POSTED!not-for-mail
From: terje.ma...@tmsw.no (Terje Mathisen)
Newsgroups: comp.arch
Subject: Re: Spectre
Date: Thu, 24 Mar 2022 11:26:47 +0100
Organization: Aioe.org NNTP Server
Message-ID: <t1hh19$1ht2$1@gioia.aioe.org>
References: <82d668ec-a140-454c-8606-9e665c750997n@googlegroups.com>
<memo.20220322141111.1928h@jgd.cix.co.uk>
<2c5bd9b0-1439-49c1-a4c8-707f27a9eb11n@googlegroups.com>
<2022Mar23.093749@mips.complang.tuwien.ac.at>
<%OF_J.126355$ZmJ7.99768@fx06.iad>
<2022Mar24.090722@mips.complang.tuwien.ac.at>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="51106"; posting-host="EhtdJS5E9ITDZpJm3Uerlg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101
Firefox/68.0 SeaMonkey/2.53.11
X-Notice: Filtered by postfilter v. 0.9.2
 by: Terje Mathisen - Thu, 24 Mar 2022 10:26 UTC

Anton Ertl wrote:
> The existing workaround (that does not need additional instructions)
> is to squash an out-of-bounds index to an in-bounds value with an
> instruction like AND or CMOV that we expect to use just data flow, not
> any prediction; this works around Spectre V1. The bounds check for
> the throw is done mostly separately.

That's one way to handle it: Allocate one extra element for all arrays
(located at index -1) and then use code like this

cmp rbx,rdi ; if (idx > limit)
sbb rax,rax ; idx = -1;
or rbx,rbx
mov rax,[rsi+rbx*8] ; return array[idx]

or alternatively, using a static safe/default load address

cmp rbx,rdi
lea rax,[default_value]
lea rbx,[rsi+rbx*8]

cmovc rbx,rax

mov rax,[rbx]

I.e. always load something but use a safe address if the index was out
of range.

Terje

--
- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"

Re: Spectre

<t1hnhr$t79$1@newsreader4.netcologne.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24446&group=comp.arch#24446

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!news.freedyn.de!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd6-30bd-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoe...@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: Spectre
Date: Thu, 24 Mar 2022 12:18:03 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <t1hnhr$t79$1@newsreader4.netcologne.de>
References: <82d668ec-a140-454c-8606-9e665c750997n@googlegroups.com>
<memo.20220322141111.1928h@jgd.cix.co.uk>
<2c5bd9b0-1439-49c1-a4c8-707f27a9eb11n@googlegroups.com>
<2022Mar23.093749@mips.complang.tuwien.ac.at>
<%OF_J.126355$ZmJ7.99768@fx06.iad>
<2022Mar24.090722@mips.complang.tuwien.ac.at>
<t1hh19$1ht2$1@gioia.aioe.org>
Injection-Date: Thu, 24 Mar 2022 12:18:03 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd6-30bd-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd6:30bd:0:7285:c2ff:fe6c:992d";
logging-data="29929"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Thu, 24 Mar 2022 12:18 UTC

Terje Mathisen <terje.mathisen@tmsw.no> schrieb:
> Anton Ertl wrote:
>> The existing workaround (that does not need additional instructions)
>> is to squash an out-of-bounds index to an in-bounds value with an
>> instruction like AND or CMOV that we expect to use just data flow, not
>> any prediction; this works around Spectre V1. The bounds check for
>> the throw is done mostly separately.
>
> That's one way to handle it: Allocate one extra element for all arrays
> (located at index -1) and then use code like this
>
> cmp rbx,rdi ; if (idx > limit)
> sbb rax,rax ; idx = -1;
> or rbx,rbx
> mov rax,[rsi+rbx*8] ; return array[idx]
>
> or alternatively, using a static safe/default load address
>
> cmp rbx,rdi
> lea rax,[default_value]
> lea rbx,[rsi+rbx*8]
>
> cmovc rbx,rax
>
> mov rax,[rbx]

Bounds-checking compilers are likely to optimize (where lbound
determines the lower bound and ubound the upper bound)

do i=1,n
call range_check (i,lbound(a,1),ubound(a,1))
a(i) = 0
end do

into

call range_check (1,lbound(a,1),ubound(a,1))
call range_check (n,lbound(a,1),ubound(a,1))

do i=1,n
a(i) = 0
end do

(where one or two of the tests may be elided due to
what is known at comple-time).

Is this also vulnerable to Spectre?

Re: Spectre

<2022Mar24.140243@mips.complang.tuwien.ac.at>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24447&group=comp.arch#24447

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.arch
Subject: Re: Spectre
Date: Thu, 24 Mar 2022 13:02:43 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 34
Distribution: world
Message-ID: <2022Mar24.140243@mips.complang.tuwien.ac.at>
References: <82d668ec-a140-454c-8606-9e665c750997n@googlegroups.com> <memo.20220322141111.1928h@jgd.cix.co.uk> <2c5bd9b0-1439-49c1-a4c8-707f27a9eb11n@googlegroups.com> <2022Mar23.093749@mips.complang.tuwien.ac.at> <%OF_J.126355$ZmJ7.99768@fx06.iad> <2022Mar24.090722@mips.complang.tuwien.ac.at> <t1hh19$1ht2$1@gioia.aioe.org> <t1hnhr$t79$1@newsreader4.netcologne.de>
Injection-Info: reader02.eternal-september.org; posting-host="d5f67e5c06b5b0e3beeb5b798e22ec52";
logging-data="8562"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19T2W0ihxv4azAf2HLthoaI"
Cancel-Lock: sha1:YCaifK7EcjPZdrM9JCXa7u4lUFo=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Thu, 24 Mar 2022 13:02 UTC

Thomas Koenig <tkoenig@netcologne.de> writes:
>Bounds-checking compilers are likely to optimize (where lbound
>determines the lower bound and ubound the upper bound)
>
> do i=1,n
> call range_check (i,lbound(a,1),ubound(a,1))
> a(i) = 0
> end do
>
>into
>
> call range_check (1,lbound(a,1),ubound(a,1))
> call range_check (n,lbound(a,1),ubound(a,1))
>
> do i=1,n
> a(i) = 0
> end do
>
>(where one or two of the tests may be elided due to
>what is known at comple-time).
>
>Is this also vulnerable to Spectre?

Probably not: While speculative execution will often continue to
speculatively write beyond the end of the array (not commited to
permanent state), I don't see a way to extract information from this
incorrect speculation. However, a loop that reads from a(i) may
reveal the contents of the data beyond a(n) if the right side channel
exists in the code.

- anton
--
'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>

Re: Spectre

<t1huuj$2tb$1@newsreader4.netcologne.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24448&group=comp.arch#24448

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd6-30bd-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoe...@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: Spectre
Date: Thu, 24 Mar 2022 14:24:19 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <t1huuj$2tb$1@newsreader4.netcologne.de>
References: <82d668ec-a140-454c-8606-9e665c750997n@googlegroups.com>
<memo.20220322141111.1928h@jgd.cix.co.uk>
<2c5bd9b0-1439-49c1-a4c8-707f27a9eb11n@googlegroups.com>
<2022Mar23.093749@mips.complang.tuwien.ac.at>
<%OF_J.126355$ZmJ7.99768@fx06.iad>
<2022Mar24.090722@mips.complang.tuwien.ac.at>
<t1hh19$1ht2$1@gioia.aioe.org> <t1hnhr$t79$1@newsreader4.netcologne.de>
<2022Mar24.140243@mips.complang.tuwien.ac.at>
Injection-Date: Thu, 24 Mar 2022 14:24:19 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd6-30bd-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd6:30bd:0:7285:c2ff:fe6c:992d";
logging-data="2987"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Thu, 24 Mar 2022 14:24 UTC

Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
> Thomas Koenig <tkoenig@netcologne.de> writes:
>>Bounds-checking compilers are likely to optimize (where lbound
>>determines the lower bound and ubound the upper bound)
>>
>> do i=1,n
>> call range_check (i,lbound(a,1),ubound(a,1))
>> a(i) = 0
>> end do
>>
>>into
>>
>> call range_check (1,lbound(a,1),ubound(a,1))
>> call range_check (n,lbound(a,1),ubound(a,1))
>>
>> do i=1,n
>> a(i) = 0
>> end do
>>
>>(where one or two of the tests may be elided due to
>>what is known at comple-time).
>>
>>Is this also vulnerable to Spectre?
>
> Probably not: While speculative execution will often continue to
> speculatively write beyond the end of the array (not commited to
> permanent state), I don't see a way to extract information from this
> incorrect speculation. However, a loop that reads from a(i) may
> reveal the contents of the data beyond a(n) if the right side channel
> exists in the code.

Hmm... so what about a "killjoy" instruction which invalidates
all speculatively generated cache entries (or more generally,
speculation state) associated with the current process?

An out-of-bounds array access is an error condition for which the
normal reaction should be process termination. Process termination
will not be predicted well, by definition, and even if it was, I don't
care if it takes 1000 cycles more :-)

Re: Spectre

<4adac34a-12b2-4c5b-adfc-f22dff59c184n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24449&group=comp.arch#24449

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:6214:1cc4:b0:435:35c3:f0f1 with SMTP id g4-20020a0562141cc400b0043535c3f0f1mr4663193qvd.0.1648133157727;
Thu, 24 Mar 2022 07:45:57 -0700 (PDT)
X-Received: by 2002:aca:905:0:b0:2ee:f62a:e08e with SMTP id
5-20020aca0905000000b002eef62ae08emr2736462oij.54.1648133157380; Thu, 24 Mar
2022 07:45:57 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Thu, 24 Mar 2022 07:45:57 -0700 (PDT)
In-Reply-To: <t1hnhr$t79$1@newsreader4.netcologne.de>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:3540:d732:845b:7c16;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:3540:d732:845b:7c16
References: <82d668ec-a140-454c-8606-9e665c750997n@googlegroups.com>
<memo.20220322141111.1928h@jgd.cix.co.uk> <2c5bd9b0-1439-49c1-a4c8-707f27a9eb11n@googlegroups.com>
<2022Mar23.093749@mips.complang.tuwien.ac.at> <%OF_J.126355$ZmJ7.99768@fx06.iad>
<2022Mar24.090722@mips.complang.tuwien.ac.at> <t1hh19$1ht2$1@gioia.aioe.org> <t1hnhr$t79$1@newsreader4.netcologne.de>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4adac34a-12b2-4c5b-adfc-f22dff59c184n@googlegroups.com>
Subject: Re: Spectre
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Thu, 24 Mar 2022 14:45:57 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 60
 by: MitchAlsup - Thu, 24 Mar 2022 14:45 UTC

On Thursday, March 24, 2022 at 7:18:06 AM UTC-5, Thomas Koenig wrote:
> Terje Mathisen <terje.m...@tmsw.no> schrieb:
> > Anton Ertl wrote:
> >> The existing workaround (that does not need additional instructions)
> >> is to squash an out-of-bounds index to an in-bounds value with an
> >> instruction like AND or CMOV that we expect to use just data flow, not
> >> any prediction; this works around Spectre V1. The bounds check for
> >> the throw is done mostly separately.
> >
> > That's one way to handle it: Allocate one extra element for all arrays
> > (located at index -1) and then use code like this
> >
> > cmp rbx,rdi ; if (idx > limit)
> > sbb rax,rax ; idx = -1;
> > or rbx,rbx
> > mov rax,[rsi+rbx*8] ; return array[idx]
> >
> > or alternatively, using a static safe/default load address
> >
> > cmp rbx,rdi
> > lea rax,[default_value]
> > lea rbx,[rsi+rbx*8]
> >
> > cmovc rbx,rax
> >
> > mov rax,[rbx]
> Bounds-checking compilers are likely to optimize (where lbound
> determines the lower bound and ubound the upper bound)
>
> do i=1,n
> call range_check (i,lbound(a,1),ubound(a,1))
> a(i) = 0
> end do
>
> into
>
> call range_check (1,lbound(a,1),ubound(a,1))
> call range_check (n,lbound(a,1),ubound(a,1))
>
> do i=1,n
> a(i) = 0
> end do
>
> (where one or two of the tests may be elided due to
> what is known at comple-time).
>
> Is this also vulnerable to Spectre?
<
The first Spectré attack front was not an out of bounds access,
but using an in bounds access to access a location in the cache
that this process had not rights to access and THEN using that
to generate a second access which should never have been
performed. So, the above does nothing to mitigate Spectré.
<
We would call this "flying blind"; you can't get the needed information
when the decision was made to access the cache a second time,
and we decided to clean it up between consistent point and retire
point.

Re: Why separate 32-bit arithmetic on a 64-bit architecture?

<1436ba6e-c0af-424a-922e-8760c70f2de8n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24454&group=comp.arch#24454

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:6214:daa:b0:441:7161:de4b with SMTP id h10-20020a0562140daa00b004417161de4bmr2697643qvh.48.1648142663998;
Thu, 24 Mar 2022 10:24:23 -0700 (PDT)
X-Received: by 2002:aca:905:0:b0:2ee:f62a:e08e with SMTP id
5-20020aca0905000000b002eef62ae08emr3122271oij.54.1648142663801; Thu, 24 Mar
2022 10:24:23 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Thu, 24 Mar 2022 10:24:23 -0700 (PDT)
In-Reply-To: <memo.20220323212939.1928x@jgd.cix.co.uk>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:56a:fb70:6300:8cfe:114a:ea0f:40ac;
posting-account=1nOeKQkAAABD2jxp4Pzmx9Hx5g9miO8y
NNTP-Posting-Host: 2001:56a:fb70:6300:8cfe:114a:ea0f:40ac
References: <20d5ecab-f2ff-4641-8914-acc6db457d80n@googlegroups.com> <memo.20220323212939.1928x@jgd.cix.co.uk>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1436ba6e-c0af-424a-922e-8760c70f2de8n@googlegroups.com>
Subject: Re: Why separate 32-bit arithmetic on a 64-bit architecture?
From: jsav...@ecn.ab.ca (Quadibloc)
Injection-Date: Thu, 24 Mar 2022 17:24:23 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 18
 by: Quadibloc - Thu, 24 Mar 2022 17:24 UTC

On Wednesday, March 23, 2022 at 3:29:44 PM UTC-6, John Dallman wrote:
> In article <20d5ecab-f2ff-4641...@googlegroups.com>,
> jsa...@ecn.ab.ca (Quadibloc) wrote:
>
> > Given that, the way to abolish Spectre for the Android world is
> > clear. Just make a low-power Itanium chip suitable for smartphones.

> Of course, that's a far better idea than the Spectre-invulnerable ARM
> Cortex-A5x CPUs that are used in most low-cost Android devices.

No, I freely admit it isn't; of course those already have the perfect
solution.

However, what about the higher-cost Android devices that use cores that
are vulnerable to Spectre? If Poulson/Kittson is the only possible
high-performance in-order chip, then it's the only alternative there is - one
just has to make a version that can run on batteries.

John Savard

Re: Spectre

<2022Mar24.183045@mips.complang.tuwien.ac.at>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24456&group=comp.arch#24456

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.arch
Subject: Re: Spectre
Date: Thu, 24 Mar 2022 17:30:45 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 28
Distribution: world
Message-ID: <2022Mar24.183045@mips.complang.tuwien.ac.at>
References: <82d668ec-a140-454c-8606-9e665c750997n@googlegroups.com> <memo.20220322141111.1928h@jgd.cix.co.uk> <2c5bd9b0-1439-49c1-a4c8-707f27a9eb11n@googlegroups.com> <2022Mar23.093749@mips.complang.tuwien.ac.at> <%OF_J.126355$ZmJ7.99768@fx06.iad> <2022Mar24.090722@mips.complang.tuwien.ac.at> <t1hh19$1ht2$1@gioia.aioe.org> <t1hnhr$t79$1@newsreader4.netcologne.de> <2022Mar24.140243@mips.complang.tuwien.ac.at> <t1huuj$2tb$1@newsreader4.netcologne.de>
Injection-Info: reader02.eternal-september.org; posting-host="d5f67e5c06b5b0e3beeb5b798e22ec52";
logging-data="4733"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX188+TRNT2gqdIpMs7lHQ8Fw"
Cancel-Lock: sha1:hhczmxJtsb+cfJQUqOX/M9JRQT4=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Thu, 24 Mar 2022 17:30 UTC

Thomas Koenig <tkoenig@netcologne.de> writes:
>Hmm... so what about a "killjoy" instruction which invalidates
>all speculatively generated cache entries (or more generally,
>speculation state) associated with the current process?

Currently existing CPUs update the cache permanently based on
speculative reads; that's the basis of the cache side channel in
Spectre. There is no way for the microarchitecture to know whether a
cache entry has been updated from a speculatively executed load, much
less whether the speculation was correct or not. But if there was
such a way and such an instruction, it would do nothing against
Spectre, because it does not change the side channel.

Now on a CPU with a Spectre fix along the lines discussed here such an
instruction would be a noop, because a cache line would not reach the
permanent cache before the instruction is committed.

>An out-of-bounds array access is an error condition for which the
>normal reaction should be process termination. Process termination
>will not be predicted well, by definition, and even if it was, I don't
>care if it takes 1000 cycles more :-)

Relevance?

- anton
--
'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>

Re: Spectre

<76040ddd-89c7-4416-a54a-0fd8784184bfn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24458&group=comp.arch#24458

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:620a:1aa2:b0:67d:1637:7a9e with SMTP id bl34-20020a05620a1aa200b0067d16377a9emr4236829qkb.680.1648144916342;
Thu, 24 Mar 2022 11:01:56 -0700 (PDT)
X-Received: by 2002:a9d:853:0:b0:5b2:617e:e982 with SMTP id
77-20020a9d0853000000b005b2617ee982mr2724343oty.333.1648144916070; Thu, 24
Mar 2022 11:01:56 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Thu, 24 Mar 2022 11:01:55 -0700 (PDT)
In-Reply-To: <t1huuj$2tb$1@newsreader4.netcologne.de>
Injection-Info: google-groups.googlegroups.com; posting-host=199.203.251.52; posting-account=ow8VOgoAAAAfiGNvoH__Y4ADRwQF1hZW
NNTP-Posting-Host: 199.203.251.52
References: <82d668ec-a140-454c-8606-9e665c750997n@googlegroups.com>
<memo.20220322141111.1928h@jgd.cix.co.uk> <2c5bd9b0-1439-49c1-a4c8-707f27a9eb11n@googlegroups.com>
<2022Mar23.093749@mips.complang.tuwien.ac.at> <%OF_J.126355$ZmJ7.99768@fx06.iad>
<2022Mar24.090722@mips.complang.tuwien.ac.at> <t1hh19$1ht2$1@gioia.aioe.org>
<t1hnhr$t79$1@newsreader4.netcologne.de> <2022Mar24.140243@mips.complang.tuwien.ac.at>
<t1huuj$2tb$1@newsreader4.netcologne.de>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <76040ddd-89c7-4416-a54a-0fd8784184bfn@googlegroups.com>
Subject: Re: Spectre
From: already5...@yahoo.com (Michael S)
Injection-Date: Thu, 24 Mar 2022 18:01:56 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 41
 by: Michael S - Thu, 24 Mar 2022 18:01 UTC

On Thursday, March 24, 2022 at 4:24:22 PM UTC+2, Thomas Koenig wrote:
> Anton Ertl <an...@mips.complang.tuwien.ac.at> schrieb:
> > Thomas Koenig <tko...@netcologne.de> writes:
> >>Bounds-checking compilers are likely to optimize (where lbound
> >>determines the lower bound and ubound the upper bound)
> >>
> >> do i=1,n
> >> call range_check (i,lbound(a,1),ubound(a,1))
> >> a(i) = 0
> >> end do
> >>
> >>into
> >>
> >> call range_check (1,lbound(a,1),ubound(a,1))
> >> call range_check (n,lbound(a,1),ubound(a,1))
> >>
> >> do i=1,n
> >> a(i) = 0
> >> end do
> >>
> >>(where one or two of the tests may be elided due to
> >>what is known at comple-time).
> >>
> >>Is this also vulnerable to Spectre?
> >
> > Probably not: While speculative execution will often continue to
> > speculatively write beyond the end of the array (not commited to
> > permanent state), I don't see a way to extract information from this
> > incorrect speculation. However, a loop that reads from a(i) may
> > reveal the contents of the data beyond a(n) if the right side channel
> > exists in the code.
> Hmm... so what about a "killjoy" instruction which invalidates
> all speculatively generated cache entries (or more generally,
> speculation state) associated with the current process?
>
> An out-of-bounds array access is an error condition for which the
> normal reaction should be process termination. Process termination
> will not be predicted well, by definition, and even if it was, I don't
> care if it takes 1000 cycles more :-)

I recommend to refresh your memory:
https://spectreattack.com/spectre.pdf

Re: Memory encryption (was: Spectre)

<456f2583-e55-71a2-2b73-3bb3653d2895@elronnd.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24463&group=comp.arch#24463

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!news.swapon.de!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: elro...@elronnd.net (Elijah Stone)
Newsgroups: comp.arch
Subject: Re: Memory encryption (was: Spectre)
Date: Fri, 25 Mar 2022 03:10:28 -0700
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <456f2583-e55-71a2-2b73-3bb3653d2895@elronnd.net>
References: <82d668ec-a140-454c-8606-9e665c750997n@googlegroups.com> <memo.20220322141111.1928h@jgd.cix.co.uk> <2c5bd9b0-1439-49c1-a4c8-707f27a9eb11n@googlegroups.com> <2022Mar23.093749@mips.complang.tuwien.ac.at> <%OF_J.126355$ZmJ7.99768@fx06.iad>
<2022Mar24.090722@mips.complang.tuwien.ac.at> <t1he8k$luk$1@newsreader4.netcologne.de> <2022Mar24.110023@mips.complang.tuwien.ac.at>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII; format=flowed
Injection-Info: reader02.eternal-september.org; posting-host="91bf46d4b3e4961dfdfe566004c8f7eb";
logging-data="10932"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18fLfbUSQ9AQwQ575qLM8EX"
Cancel-Lock: sha1:dka9qZumTUhfFHSQfcsTQf1lYe4=
In-Reply-To: <2022Mar24.110023@mips.complang.tuwien.ac.at>
 by: Elijah Stone - Fri, 25 Mar 2022 10:10 UTC

On Thu, 24 Mar 2022, Anton Ertl wrote:

>> Could an alternative be memory encryption?
>
> No. In a Spectre attack the attacked process reads the memory
> (speculatively), and it will decrypt it speculatively

Use a different key for every process. Now when you decrypt it
speculatively, if it wasn't your memory, you get the wrong result.

That doesn't work for shared memory. Are there any other problems? Any
obvious workarounds for shared memory?

Re: Memory encryption (was: Spectre)

<d635a22e-2b67-4603-8738-684f774069c7n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24465&group=comp.arch#24465

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:622a:208:b0:2e1:b3ec:b7ce with SMTP id b8-20020a05622a020800b002e1b3ecb7cemr8871453qtx.345.1648207217314;
Fri, 25 Mar 2022 04:20:17 -0700 (PDT)
X-Received: by 2002:a9d:644b:0:b0:5cd:a627:c439 with SMTP id
m11-20020a9d644b000000b005cda627c439mr3908963otl.112.1648207217045; Fri, 25
Mar 2022 04:20:17 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Fri, 25 Mar 2022 04:20:16 -0700 (PDT)
In-Reply-To: <456f2583-e55-71a2-2b73-3bb3653d2895@elronnd.net>
Injection-Info: google-groups.googlegroups.com; posting-host=2a0d:6fc2:55b0:ca00:2129:c853:ffd9:145d;
posting-account=ow8VOgoAAAAfiGNvoH__Y4ADRwQF1hZW
NNTP-Posting-Host: 2a0d:6fc2:55b0:ca00:2129:c853:ffd9:145d
References: <82d668ec-a140-454c-8606-9e665c750997n@googlegroups.com>
<memo.20220322141111.1928h@jgd.cix.co.uk> <2c5bd9b0-1439-49c1-a4c8-707f27a9eb11n@googlegroups.com>
<2022Mar23.093749@mips.complang.tuwien.ac.at> <%OF_J.126355$ZmJ7.99768@fx06.iad>
<2022Mar24.090722@mips.complang.tuwien.ac.at> <t1he8k$luk$1@newsreader4.netcologne.de>
<2022Mar24.110023@mips.complang.tuwien.ac.at> <456f2583-e55-71a2-2b73-3bb3653d2895@elronnd.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d635a22e-2b67-4603-8738-684f774069c7n@googlegroups.com>
Subject: Re: Memory encryption (was: Spectre)
From: already5...@yahoo.com (Michael S)
Injection-Date: Fri, 25 Mar 2022 11:20:17 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 13
 by: Michael S - Fri, 25 Mar 2022 11:20 UTC

On Friday, March 25, 2022 at 1:10:37 PM UTC+3, Elijah Stone wrote:
> On Thu, 24 Mar 2022, Anton Ertl wrote:
>
> >> Could an alternative be memory encryption?
> >
> > No. In a Spectre attack the attacked process reads the memory
> > (speculatively), and it will decrypt it speculatively
> Use a different key for every process. Now when you decrypt it
> speculatively, if it wasn't your memory, you get the wrong result.
>
> That doesn't work for shared memory. Are there any other problems? Any
> obvious workarounds for shared memory?

Spectre-V1 (bound check bypass) is in-process attack.

Re: Memory encryption (was: Spectre)

<2022Mar25.122217@mips.complang.tuwien.ac.at>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24466&group=comp.arch#24466

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.arch
Subject: Re: Memory encryption (was: Spectre)
Date: Fri, 25 Mar 2022 11:22:17 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 24
Message-ID: <2022Mar25.122217@mips.complang.tuwien.ac.at>
References: <82d668ec-a140-454c-8606-9e665c750997n@googlegroups.com> <memo.20220322141111.1928h@jgd.cix.co.uk> <2c5bd9b0-1439-49c1-a4c8-707f27a9eb11n@googlegroups.com> <2022Mar23.093749@mips.complang.tuwien.ac.at> <%OF_J.126355$ZmJ7.99768@fx06.iad> <2022Mar24.090722@mips.complang.tuwien.ac.at> <t1he8k$luk$1@newsreader4.netcologne.de> <2022Mar24.110023@mips.complang.tuwien.ac.at> <456f2583-e55-71a2-2b73-3bb3653d2895@elronnd.net>
Injection-Info: reader02.eternal-september.org; posting-host="ad84977fa7c54fe274832a2ec8313afe";
logging-data="4208"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18l/guHZyoNLHYZY3leEXH9"
Cancel-Lock: sha1:e6fuhRZXWut5t0W8PMYN599MLBo=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Fri, 25 Mar 2022 11:22 UTC

Elijah Stone <elronnd@elronnd.net> writes:
>On Thu, 24 Mar 2022, Anton Ertl wrote:
>
>>> Could an alternative be memory encryption?
>>
>> No. In a Spectre attack the attacked process reads the memory
>> (speculatively), and it will decrypt it speculatively
>
>Use a different key for every process.

That's what I assumed.

>Now when you decrypt it
>speculatively, if it wasn't your memory, you get the wrong result.

A process normally cannot access other processes memory anyway.

But in Spectre the attacker lets the owning process read the memory.
Therefore encrypting the memory contents won't help.

- anton
--
'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>

Re: Memory encryption (was: Spectre)

<fb395102-65c6-43b0-888f-b4a24b4cef7dn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24470&group=comp.arch#24470

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:6214:621:b0:432:5e0d:cb64 with SMTP id a1-20020a056214062100b004325e0dcb64mr9355321qvx.65.1648221395171;
Fri, 25 Mar 2022 08:16:35 -0700 (PDT)
X-Received: by 2002:a05:6808:1152:b0:2da:c7f:66c2 with SMTP id
u18-20020a056808115200b002da0c7f66c2mr10268988oiu.253.1648221394912; Fri, 25
Mar 2022 08:16:34 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Fri, 25 Mar 2022 08:16:34 -0700 (PDT)
In-Reply-To: <2022Mar25.122217@mips.complang.tuwien.ac.at>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:a0b7:ad45:609a:53bb;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:a0b7:ad45:609a:53bb
References: <82d668ec-a140-454c-8606-9e665c750997n@googlegroups.com>
<memo.20220322141111.1928h@jgd.cix.co.uk> <2c5bd9b0-1439-49c1-a4c8-707f27a9eb11n@googlegroups.com>
<2022Mar23.093749@mips.complang.tuwien.ac.at> <%OF_J.126355$ZmJ7.99768@fx06.iad>
<2022Mar24.090722@mips.complang.tuwien.ac.at> <t1he8k$luk$1@newsreader4.netcologne.de>
<2022Mar24.110023@mips.complang.tuwien.ac.at> <456f2583-e55-71a2-2b73-3bb3653d2895@elronnd.net>
<2022Mar25.122217@mips.complang.tuwien.ac.at>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <fb395102-65c6-43b0-888f-b4a24b4cef7dn@googlegroups.com>
Subject: Re: Memory encryption (was: Spectre)
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Fri, 25 Mar 2022 15:16:35 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 24
 by: MitchAlsup - Fri, 25 Mar 2022 15:16 UTC

On Friday, March 25, 2022 at 6:28:14 AM UTC-5, Anton Ertl wrote:
> Elijah Stone <elr...@elronnd.net> writes:
> >On Thu, 24 Mar 2022, Anton Ertl wrote:
> >
> >>> Could an alternative be memory encryption?
> >>
> >> No. In a Spectre attack the attacked process reads the memory
> >> (speculatively), and it will decrypt it speculatively
> >
> >Use a different key for every process.
> That's what I assumed.
> >Now when you decrypt it
> >speculatively, if it wasn't your memory, you get the wrong result.
> A process normally cannot access other processes memory anyway.
>
> But in Spectre the attacker lets the owning process read the memory.
> Therefore encrypting the memory contents won't help.
<
Encryption would have to be present throughout the cache hierarchy.
This would not be good for L1 performance.
<
> - anton
> --
> 'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
> Mitch Alsup, <c17fcd89-f024-40e7...@googlegroups.com>

Re: Memory encryption (was: Spectre)

<t1l0dq$5qb$1@newsreader4.netcologne.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24474&group=comp.arch#24474

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd6-30bd-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoe...@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: Memory encryption (was: Spectre)
Date: Fri, 25 Mar 2022 18:07:54 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <t1l0dq$5qb$1@newsreader4.netcologne.de>
References: <82d668ec-a140-454c-8606-9e665c750997n@googlegroups.com>
<memo.20220322141111.1928h@jgd.cix.co.uk>
<2c5bd9b0-1439-49c1-a4c8-707f27a9eb11n@googlegroups.com>
<2022Mar23.093749@mips.complang.tuwien.ac.at>
<%OF_J.126355$ZmJ7.99768@fx06.iad>
<2022Mar24.090722@mips.complang.tuwien.ac.at>
<t1he8k$luk$1@newsreader4.netcologne.de>
<2022Mar24.110023@mips.complang.tuwien.ac.at>
<456f2583-e55-71a2-2b73-3bb3653d2895@elronnd.net>
<2022Mar25.122217@mips.complang.tuwien.ac.at>
Injection-Date: Fri, 25 Mar 2022 18:07:54 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd6-30bd-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd6:30bd:0:7285:c2ff:fe6c:992d";
logging-data="5963"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Fri, 25 Mar 2022 18:07 UTC

Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
> Elijah Stone <elronnd@elronnd.net> writes:
>>On Thu, 24 Mar 2022, Anton Ertl wrote:
>>
>>>> Could an alternative be memory encryption?
>>>
>>> No. In a Spectre attack the attacked process reads the memory
>>> (speculatively), and it will decrypt it speculatively
>>
>>Use a different key for every process.
>
> That's what I assumed.
>
>>Now when you decrypt it
>>speculatively, if it wasn't your memory, you get the wrong result.
>
> A process normally cannot access other processes memory anyway.
>
> But in Spectre the attacker lets the owning process read the memory.
> Therefore encrypting the memory contents won't help.

If it still was encrypted while in L1, that would not help?

Re: Memory encryption (was: Spectre)

<2022Mar25.191516@mips.complang.tuwien.ac.at>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24475&group=comp.arch#24475

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.arch
Subject: Re: Memory encryption (was: Spectre)
Date: Fri, 25 Mar 2022 18:15:16 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 30
Distribution: world
Message-ID: <2022Mar25.191516@mips.complang.tuwien.ac.at>
References: <82d668ec-a140-454c-8606-9e665c750997n@googlegroups.com> <2c5bd9b0-1439-49c1-a4c8-707f27a9eb11n@googlegroups.com> <2022Mar23.093749@mips.complang.tuwien.ac.at> <%OF_J.126355$ZmJ7.99768@fx06.iad> <2022Mar24.090722@mips.complang.tuwien.ac.at> <t1he8k$luk$1@newsreader4.netcologne.de> <2022Mar24.110023@mips.complang.tuwien.ac.at> <456f2583-e55-71a2-2b73-3bb3653d2895@elronnd.net> <2022Mar25.122217@mips.complang.tuwien.ac.at> <t1l0dq$5qb$1@newsreader4.netcologne.de>
Injection-Info: reader02.eternal-september.org; posting-host="ad84977fa7c54fe274832a2ec8313afe";
logging-data="21928"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+AFSrU4YIKas+6YhMmHW9r"
Cancel-Lock: sha1:4vdWnAvWYZaf2L7Mkz5obAmFjCw=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Fri, 25 Mar 2022 18:15 UTC

Thomas Koenig <tkoenig@netcologne.de> writes:
>Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
>> Elijah Stone <elronnd@elronnd.net> writes:
>>>On Thu, 24 Mar 2022, Anton Ertl wrote:
>>>
>>>>> Could an alternative be memory encryption?
>>>>
>>>> No. In a Spectre attack the attacked process reads the memory
>>>> (speculatively), and it will decrypt it speculatively
>>>
>>>Use a different key for every process.
>>
>> That's what I assumed.
>>
>>>Now when you decrypt it
>>>speculatively, if it wasn't your memory, you get the wrong result.
>>
>> A process normally cannot access other processes memory anyway.
>>
>> But in Spectre the attacker lets the owning process read the memory.
>> Therefore encrypting the memory contents won't help.
>
>If it still was encrypted while in L1, that would not help?

No.

- anton
--
'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>

Pages:1234567
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor