Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

Badges? We don't need no stinking badges.


devel / comp.arch / amd zen2 bug in vzeroupper

SubjectAuthor
* amd zen2 bug in vzeroupperTavis Ormandy
`* Re: amd zen2 bug in vzeroupperAnton Ertl
 `- Re: amd zen2 bug in vzeroupperMitchAlsup

1
amd zen2 bug in vzeroupper

<kiv4pmFdmdU1@mid.individual.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=33546&group=comp.arch#33546

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: taviso@gmail.com (Tavis Ormandy)
Newsgroups: comp.arch
Subject: amd zen2 bug in vzeroupper
Date: 2 Aug 2023 13:42:14 GMT
Lines: 25
Message-ID: <kiv4pmFdmdU1@mid.individual.net>
X-Trace: individual.net ptVvTT+0QQtMSR8FlzlZ7g59AWisT1Dr7XuHH50LwcpuhNgWk9
Cancel-Lock: sha1:dXhjwsslslj07nvors0It9sqW/k= sha256:6OrXJoShFiVpIvA0IvKqU1qGhvCYLjAZ+iQKyC9Gr1o=
User-Agent: slrn/pre1.0.4-5 (Linux)
 by: Tavis Ormandy - Wed, 2 Aug 2023 13:42 UTC

I wrote an article about a bug I found on AMD Zen2. The problem is that
a speculatively executed VZEROUPPER instruction will not be rolled back
correctly on branch misprediction:

https://lock.cmpxchg8b.com/zenbleed.html

Essentially, a code sequence like this:

vcvtsi2s{s,d} xmm, xmm, r64
vmovdqa ymm, ymm
jcc overzero
vzeroupper
overzero:
nop

There's a microcode patch available (or a chicken bit).

I thought this group might be interested in the details!

Tavis.

--
_o) $ lynx lock.cmpxchg8b.com
/\\ _o) _o) $ finger taviso@sdf.org
_\_V _( ) _( ) @taviso

Re: amd zen2 bug in vzeroupper

<2023Aug2.193203@mips.complang.tuwien.ac.at>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=33549&group=comp.arch#33549

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.arch
Subject: Re: amd zen2 bug in vzeroupper
Date: Wed, 02 Aug 2023 17:32:03 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 46
Message-ID: <2023Aug2.193203@mips.complang.tuwien.ac.at>
References: <kiv4pmFdmdU1@mid.individual.net>
Injection-Info: dont-email.me; posting-host="883f522f72f3a64e2d4eadd60205df91";
logging-data="225346"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19i7038KjH/roGHSsJ/658N"
Cancel-Lock: sha1:+iglc5kbd/briPxabDt3V/R7Rxc=
X-newsreader: xrn 10.11
 by: Anton Ertl - Wed, 2 Aug 2023 17:32 UTC

Tavis Ormandy <taviso@gmail.com> writes:
>I wrote an article about a bug I found on AMD Zen2. The problem is that
>a speculatively executed VZEROUPPER instruction will not be rolled back
>correctly on branch misprediction:
>
>https://lock.cmpxchg8b.com/zenbleed.html
>
>Essentially, a code sequence like this:
>
> vcvtsi2s{s,d} xmm, xmm, r64
> vmovdqa ymm, ymm
> jcc overzero
> vzeroupper
> overzero:
> nop
>
>There's a microcode patch available (or a chicken bit).
>
>I thought this group might be interested in the details!

Thanks for turning up here yourself. I found your blog posting
through some web site, and expected someone to mention it here, but it
did not happen. I myself wanted to check what the xmm merge
optimization is before writing anything.

What I find most interesting about this vulnerability is that it
extracts speculatively-gotten material not through a side channel, but
through architectural state, i.e., the main channel. This is OoO CPU
design 101, and they should have gotten it right (and apparently got
it right for Zen 3; I wonder if the Zen 2 bug was noticed at some
point, or if the lack of this vulnerability on Zen 3 is just due to
redesign without noticing that something is amiss.

What is also interesting is that despite this being an architecturally
visible bug, apparently nobody noticed it when doing ordinary
programming. You found it through fuzzing.

Your fuzzing technique for architectural bugs is also quite
interesting. Did you expect to find some?

What does the DE_CFG[9] chicken bit disable?

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

Re: amd zen2 bug in vzeroupper

<e67b5b98-c2c5-430a-9373-142acd3ff2e3n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=33550&group=comp.arch#33550

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:620a:cd2:b0:76c:daf4:2787 with SMTP id b18-20020a05620a0cd200b0076cdaf42787mr5847qkj.4.1691000566269;
Wed, 02 Aug 2023 11:22:46 -0700 (PDT)
X-Received: by 2002:a05:6830:1103:b0:6b9:2cd4:a857 with SMTP id
w3-20020a056830110300b006b92cd4a857mr17170132otq.6.1691000566020; Wed, 02 Aug
2023 11:22:46 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Wed, 2 Aug 2023 11:22:45 -0700 (PDT)
In-Reply-To: <2023Aug2.193203@mips.complang.tuwien.ac.at>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:ec71:f173:6cd9:8b62;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:ec71:f173:6cd9:8b62
References: <kiv4pmFdmdU1@mid.individual.net> <2023Aug2.193203@mips.complang.tuwien.ac.at>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e67b5b98-c2c5-430a-9373-142acd3ff2e3n@googlegroups.com>
Subject: Re: amd zen2 bug in vzeroupper
From: MitchAlsup@aol.com (MitchAlsup)
Injection-Date: Wed, 02 Aug 2023 18:22:46 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3708
 by: MitchAlsup - Wed, 2 Aug 2023 18:22 UTC

On Wednesday, August 2, 2023 at 12:53:31 PM UTC-5, Anton Ertl wrote:
> Tavis Ormandy <tav...@gmail.com> writes:
> >I wrote an article about a bug I found on AMD Zen2. The problem is that
> >a speculatively executed VZEROUPPER instruction will not be rolled back
> >correctly on branch misprediction:
> >
> >https://lock.cmpxchg8b.com/zenbleed.html
> >
> >Essentially, a code sequence like this:
> >
> > vcvtsi2s{s,d} xmm, xmm, r64
> > vmovdqa ymm, ymm
> > jcc overzero
> > vzeroupper
> > overzero:
> > nop
> >
> >There's a microcode patch available (or a chicken bit).
> >
> >I thought this group might be interested in the details!
<
> Thanks for turning up here yourself. I found your blog posting
> through some web site, and expected someone to mention it here, but it
> did not happen. I myself wanted to check what the xmm merge
> optimization is before writing anything.
>
> What I find most interesting about this vulnerability is that it
> extracts speculatively-gotten material not through a side channel, but
> through architectural state, i.e., the main channel. This is OoO CPU
> design 101, and they should have gotten it right (and apparently got
> it right for Zen 3; I wonder if the Zen 2 bug was noticed at some
> point, or if the lack of this vulnerability on Zen 3 is just due to
> redesign without noticing that something is amiss.
<
Back in 1983 when we first started designing Mc 88100 we had a rule
whereby if any bit of a register* is modified, then all of the bits of that
register are modified.
<
Had this rule been considered, this bug would not have manifest itself.
<
(*) GPR, FPR, CC, PTE, .....
>
> What is also interesting is that despite this being an architecturally
> visible bug, apparently nobody noticed it when doing ordinary
> programming. You found it through fuzzing.
<
This is a side effect of throwing in more instructions per generation
than you can verify. It probably got lost in some vast vector of new
instruction additions.
>
> Your fuzzing technique for architectural bugs is also quite
> interesting. Did you expect to find some?
>
> What does the DE_CFG[9] chicken bit disable?
>
> - anton
> --
> 'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
> Mitch Alsup, <c17fcd89-f024-40e7...@googlegroups.com>

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor