<s>
Lazy	B-Error_Name
FPU	I-Error_Name
state	I-Error_Name
leak	I-Error_Name
(	O
)	O
,	O
also	O
referred	O
to	O
as	O
Lazy	B-Error_Name
FP	I-Error_Name
State	I-Error_Name
Restore	I-Error_Name
or	O
LazyFP	B-Error_Name
,	O
is	O
a	O
security	O
vulnerability	O
affecting	O
Intel	B-Device
Core	I-Device
CPUs	O
.	O
</s>
<s>
The	O
vulnerability	O
is	O
caused	O
by	O
a	O
combination	O
of	O
flaws	O
in	O
the	O
speculative	B-General_Concept
execution	I-General_Concept
technology	O
present	O
within	O
the	O
affected	O
CPUs	O
and	O
how	O
certain	O
operating	O
systems	O
handle	O
context	B-Operating_System
switching	I-Operating_System
on	O
the	O
floating	B-General_Concept
point	I-General_Concept
unit	I-General_Concept
(	O
FPU	O
)	O
.	O
</s>
<s>
By	O
exploiting	O
this	O
vulnerability	O
,	O
a	O
local	O
process	B-Operating_System
can	O
leak	O
the	O
content	O
of	O
the	O
FPU	O
registers	O
that	O
belong	O
to	O
another	O
process	B-Operating_System
.	O
</s>
<s>
This	O
vulnerability	O
is	O
related	O
to	O
the	O
Spectre	B-Error_Name
and	O
Meltdown	B-Architecture
vulnerabilities	I-Architecture
that	O
were	O
publicly	O
disclosed	O
in	O
January	O
2018	O
.	O
</s>
<s>
It	O
was	O
announced	O
by	O
Intel	O
on	O
13	O
June	O
2018	O
,	O
after	O
being	O
discovered	O
by	O
employees	O
at	O
Amazon	B-Application
,	O
Cyberus	O
Technology	O
and	O
SYSGO	O
.	O
</s>
<s>
Besides	O
being	O
used	O
for	O
floating	B-Algorithm
point	I-Algorithm
arithmetic	I-Algorithm
,	O
the	O
FPU	O
registers	O
are	O
also	O
used	O
for	O
other	O
purposes	O
,	O
including	O
for	O
storing	O
cryptographic	O
data	O
when	O
using	O
the	O
AES	B-Algorithm
instruction	I-Algorithm
set	I-Algorithm
,	O
present	O
in	O
many	O
Intel	O
CPUs	O
.	O
</s>
<s>
The	O
floating	B-Algorithm
point	I-Algorithm
and	O
SIMD	B-Device
registers	O
are	O
large	O
,	O
and	O
not	O
used	O
by	O
every	O
task	O
(	O
or	O
thread	O
)	O
in	O
the	O
system	O
.	O
</s>
<s>
To	O
make	O
context	B-Operating_System
switching	I-Operating_System
faster	O
,	O
most	O
common	O
microprocessors	O
support	O
lazy	O
state	O
switching	O
.	O
</s>
<s>
Rather	O
than	O
storing	O
the	O
full	O
state	O
during	O
a	O
context	B-Operating_System
switch	I-Operating_System
,	O
the	O
operating	O
system	O
can	O
simply	O
mark	O
the	O
FPU	O
"	O
not	O
available	O
"	O
in	O
the	O
hopes	O
that	O
the	O
switched-to	O
task	O
will	O
not	O
need	O
it	O
.	O
</s>
<s>
If	O
the	O
guess	O
is	O
wrong	O
,	O
the	O
first	O
FPU	O
or	O
SIMD	B-Device
instruction	O
will	O
cause	O
a	O
trap	O
to	O
the	O
operating	O
system	O
,	O
which	O
can	O
then	O
save	O
the	O
state	O
to	O
the	O
previous	O
task	O
and	O
load	O
the	O
correct	O
state	O
for	O
the	O
current	O
task	O
.	O
</s>
<s>
The	O
processor	O
speculatively	B-General_Concept
executes	I-General_Concept
the	O
instruction	O
using	O
the	O
previous	O
task	O
's	O
register	O
contents	O
,	O
and	O
some	O
following	O
instructions	O
,	O
and	O
only	O
later	O
detects	O
the	O
FPU	O
not	O
available	O
condition	O
.	O
</s>
<s>
Exploitation	O
then	O
follows	O
the	O
same	O
pattern	O
as	O
all	O
Spectre-family	O
vulnerabilities	O
:	O
as	O
the	O
cache	O
state	O
is	O
not	O
architectural	O
state	O
(	O
the	O
cache	O
only	O
affect	O
speed	O
,	O
not	O
correctness	O
)	O
,	O
the	O
cache	O
load	O
is	O
not	O
undone	O
and	O
the	O
address	O
,	O
including	O
part	O
of	O
the	O
previous	O
task	O
's	O
register	O
state	O
,	O
can	O
later	O
be	O
detected	O
by	O
measuring	O
the	O
time	O
taken	O
to	O
access	O
different	O
memory	O
addresses	O
.	O
</s>
<s>
By	O
placing	O
the	O
FPU	O
access	O
in	O
the	O
shadow	O
of	O
a	O
forced	O
branch	B-General_Concept
misprediction	I-General_Concept
(	O
e.g.	O
</s>
<s>
using	O
a	O
retpoline	O
)	O
the	O
processor	O
will	O
still	O
speculatively	B-General_Concept
execute	I-General_Concept
the	O
code	O
,	O
but	O
will	O
rewind	O
to	O
the	O
mispredicted	O
branch	O
and	O
never	O
actually	O
execute	O
the	O
operating	O
system	O
trap	O
.	O
</s>
<s>
This	O
allows	O
the	O
attack	O
to	O
be	O
rapidly	O
repeated	O
,	O
quickly	O
reading	O
out	O
the	O
entire	O
FPU	O
and	O
SIMD	B-Device
register	O
state	O
.	O
</s>
<s>
It	O
is	O
possible	O
to	O
mitigate	O
the	O
vulnerability	O
at	O
the	O
operating	O
system	O
and	O
hypervisor	B-Operating_System
levels	O
by	O
always	O
restoring	O
the	O
FPU	O
state	O
when	O
switching	O
process	B-Operating_System
contexts	O
.	O
</s>
<s>
With	O
such	O
a	O
fix	O
,	O
no	O
firmware	B-Application
upgrade	O
is	O
required	O
.	O
</s>
<s>
Also	O
,	O
many	O
system	B-Application
software	I-Application
vendors	O
and	O
projects	O
,	O
including	O
Linux	B-Application
distributions	I-Application
,	O
OpenBSD	B-Operating_System
,	O
and	O
Xen	B-Operating_System
have	O
released	O
patches	O
to	O
address	O
the	O
vulnerability	O
.	O
</s>
