<s>
The	O
Pentium	B-Error_Name
F00F	I-Error_Name
bug	I-Error_Name
is	O
a	O
design	O
flaw	O
in	O
the	O
majority	O
of	O
Intel	B-General_Concept
Pentium	I-General_Concept
,	O
Pentium	B-General_Concept
MMX	O
,	O
and	O
Pentium	B-Device
OverDrive	I-Device
processors	O
(	O
all	O
in	O
the	O
P5	B-General_Concept
microarchitecture	I-General_Concept
)	O
.	O
</s>
<s>
Discovered	O
in	O
1997	O
,	O
it	O
can	O
result	O
in	O
the	O
processor	B-Architecture
ceasing	O
to	O
function	O
until	O
the	O
computer	O
is	O
physically	O
rebooted	O
.	O
</s>
<s>
The	O
bug	B-Error_Name
has	O
been	O
circumvented	O
through	O
operating	B-General_Concept
system	I-General_Concept
updates	O
.	O
</s>
<s>
More	O
formally	O
,	O
the	O
bug	B-Error_Name
is	O
called	O
the	O
invalid	B-Error_Name
operand	I-Error_Name
with	I-Error_Name
locked	I-Error_Name
CMPXCHG8B	I-Error_Name
instruction	I-Error_Name
bug	B-Error_Name
.	O
</s>
<s>
In	O
the	O
x86	B-Operating_System
architecture	I-Operating_System
,	O
the	O
byte	B-Application
sequence	O
F0	O
0F	O
C7	O
C8	O
represents	O
the	O
instruction	O
lock	O
cmpxchg8b	O
eax	O
(	O
locked	O
compare	O
and	O
exchange	O
of	O
8	O
bytes	B-Application
in	O
register	O
EAX	O
)	O
.	O
</s>
<s>
The	O
bug	B-Error_Name
also	O
applies	O
to	O
opcodes	O
ending	O
in	O
C9	O
through	O
CF	O
,	O
which	O
specify	O
register	O
operands	O
other	O
than	O
EAX	O
.	O
</s>
<s>
The	O
F0	O
0F	O
C7	O
C8	O
instruction	O
does	O
not	O
require	O
any	O
special	B-Operating_System
privileges	I-Operating_System
.	O
</s>
<s>
The	O
cmpxchg8b	O
instruction	O
compares	O
the	O
value	O
in	O
the	O
EDX	O
and	O
EAX	O
registers	B-General_Concept
with	O
an	O
8-byte	O
value	O
in	O
a	O
memory	O
location	O
.	O
</s>
<s>
Under	O
normal	O
circumstances	O
,	O
this	O
would	O
simply	O
result	O
in	O
an	O
exception	B-General_Concept
;	O
however	O
,	O
when	O
used	O
with	O
the	O
lock	O
prefix	O
(	O
normally	O
used	O
to	O
prevent	O
two	O
processors	O
from	O
interfering	O
with	O
the	O
same	O
memory	O
location	O
)	O
,	O
the	O
CPU	O
erroneously	O
uses	O
locked	O
bus	O
cycles	O
to	O
read	O
the	O
illegal	O
instruction	O
exception-handler	O
descriptor	O
.	O
</s>
<s>
Due	O
to	O
the	O
proliferation	O
of	O
Intel	O
microprocessors	B-Architecture
,	O
the	O
existence	O
of	O
this	O
open-privilege	O
instruction	O
was	O
considered	O
a	O
serious	O
issue	O
at	O
the	O
time	O
.	O
</s>
<s>
Operating	B-General_Concept
system	I-General_Concept
vendors	O
responded	O
by	O
implementing	O
workarounds	B-Application
that	O
detected	O
the	O
condition	O
and	O
prevented	O
the	O
crash	O
.	O
</s>
<s>
Information	O
about	O
the	O
bug	B-Error_Name
first	O
appeared	O
on	O
the	O
Internet	O
on	O
or	O
around	O
8	O
November	O
1997	O
.	O
</s>
<s>
Since	O
the	O
F00F	B-Error_Name
bug	I-Error_Name
has	O
become	O
common	O
knowledge	O
,	O
the	O
term	O
is	O
sometimes	O
used	O
to	O
describe	O
similar	O
hardware	O
design	O
flaws	O
such	O
as	O
the	O
Cyrix	B-Error_Name
coma	I-Error_Name
bug	I-Error_Name
.	O
</s>
<s>
No	O
permanent	O
hardware	O
damage	O
results	O
from	O
executing	O
the	O
F00F	B-Error_Name
instruction	O
on	O
a	O
vulnerable	O
system	O
;	O
it	O
simply	O
locks	O
up	O
until	O
rebooted	O
.	O
</s>
<s>
However	O
,	O
data	B-General_Concept
loss	I-General_Concept
of	O
unsaved	O
data	O
is	O
likely	O
if	O
the	O
disk	B-General_Concept
buffers	I-General_Concept
have	O
not	O
been	O
flushed	O
,	O
if	O
drives	O
were	O
interrupted	O
during	O
a	O
write	O
operation	O
,	O
or	O
if	O
some	O
other	O
non-atomic	O
operation	O
was	O
interrupted	O
.	O
</s>
<s>
The	O
myB2	O
stepping	B-General_Concept
solved	O
this	O
issue	O
for	O
Intel	O
's	O
Pentium	B-Device
processors	I-Device
.	O
</s>
<s>
The	O
F00F	B-Error_Name
instruction	O
can	O
be	O
considered	O
an	O
example	O
of	O
a	O
Halt	B-Language
and	I-Language
Catch	I-Language
Fire	I-Language
(	O
HCF	B-Language
)	O
instruction	O
.	O
</s>
<s>
Although	O
a	O
definite	O
solution	O
to	O
this	O
problem	O
required	O
some	O
sort	O
of	O
hardware/firmware	O
revision	O
,	O
there	O
were	O
proposed	O
workarounds	B-Application
at	O
the	O
time	O
which	O
prevented	O
the	O
exploitation	O
of	O
this	O
issue	O
in	O
generating	O
a	O
denial-of-service	O
attack	O
on	O
the	O
affected	O
machine	O
.	O
</s>
<s>
All	O
of	O
them	O
were	O
based	O
on	O
forcefully	O
breaking	O
up	O
the	O
pattern	O
of	O
faulty	O
bus	O
accesses	O
responsible	O
for	O
the	O
processor	B-Architecture
hang	O
.	O
</s>
<s>
Intel	O
's	O
proposed	O
(	O
therefore	O
"	O
official	O
"	O
)	O
solutions	O
required	O
setting	O
up	O
the	O
table	O
of	O
interrupt	O
descriptors	O
in	O
an	O
unnatural	O
way	O
that	O
forced	O
the	O
processor	B-Architecture
to	O
issue	O
an	O
intervening	O
page	O
fault	O
before	O
it	O
could	O
access	O
the	O
memory	O
containing	O
the	O
descriptor	O
for	O
the	O
undefined-opcode	O
exception	B-General_Concept
.	O
</s>
<s>
These	O
extraneous	O
memory	O
accesses	O
turned	O
out	O
to	O
be	O
sufficient	O
for	O
the	O
bus	O
interface	O
to	O
let	O
go	O
of	O
the	O
locking	O
requirement	O
that	O
was	O
the	O
root	O
cause	O
for	O
the	O
bug	B-Error_Name
.	O
</s>
<s>
Specifically	O
,	O
the	O
table	O
of	O
interrupt	O
descriptors	O
,	O
which	O
normally	O
resides	O
on	O
a	O
single	O
memory	O
page	O
,	O
is	O
instead	O
split	O
over	O
two	O
pages	O
such	O
that	O
the	O
descriptors	O
for	O
the	O
first	O
seven	O
exception	B-General_Concept
handlers	I-General_Concept
reside	O
on	O
a	O
page	O
,	O
and	O
the	O
remainder	O
of	O
the	O
table	O
on	O
the	O
following	O
page	O
.	O
</s>
<s>
The	O
handler	O
for	O
the	O
undefined	O
opcode	O
exception	B-General_Concept
is	O
then	O
the	O
last	O
descriptor	O
on	O
the	O
first	O
page	O
,	O
while	O
the	O
handler	O
for	O
the	O
page-fault	O
exception	B-General_Concept
resides	O
on	O
the	O
second	O
page	O
.	O
</s>
<s>
The	O
first	O
page	O
can	O
now	O
be	O
made	O
not-present	O
(	O
usually	O
signifying	O
a	O
page	O
that	O
has	O
been	O
swapped	O
out	O
to	O
disk	O
to	O
make	O
room	O
for	O
some	O
other	O
data	O
)	O
,	O
which	O
will	O
force	O
the	O
processor	B-Architecture
to	O
fetch	O
the	O
descriptor	O
for	O
the	O
page-fault	O
exception	B-General_Concept
handler	I-General_Concept
.	O
</s>
<s>
This	O
descriptor	O
,	O
residing	O
on	O
the	O
second	O
page	O
of	O
the	O
table	O
,	O
is	O
present	O
in	O
memory	O
as	O
usual	O
(	O
if	O
it	O
were	O
not	O
,	O
the	O
processor	B-Architecture
would	O
double	B-General_Concept
-	O
and	O
then	O
triple-fault	B-Error_Name
,	O
leading	O
to	O
a	O
shutdown	O
)	O
.	O
</s>
<s>
These	O
extra	O
memory	O
cycles	O
override	O
the	O
memory	O
locking	O
requirement	O
issued	O
by	O
the	O
original	O
illegal	O
instruction	O
(	O
since	O
faulting	O
instructions	O
are	O
supposed	O
to	O
be	O
able	O
to	O
be	O
restarted	O
after	O
the	O
exception	B-General_Concept
handler	I-General_Concept
returns	O
)	O
.	O
</s>
<s>
The	O
handler	O
for	O
the	O
page-fault	O
exception	B-General_Concept
has	O
to	O
be	O
modified	O
,	O
however	O
,	O
to	O
cope	O
with	O
the	O
necessity	O
of	O
providing	O
the	O
missing	O
page	O
for	O
the	O
first	O
half	O
of	O
the	O
interrupt	O
descriptor	O
table	O
,	O
a	O
task	O
it	O
is	O
not	O
usually	O
required	O
to	O
perform	O
.	O
</s>
<s>
The	O
second	O
official	O
workaround	B-Application
from	O
Intel	O
proposed	O
keeping	O
all	O
pages	O
present	O
in	O
memory	O
,	O
but	O
marking	O
the	O
first	O
page	O
read-only	O
.	O
</s>
<s>
However	O
,	O
this	O
variant	O
requires	O
that	O
the	O
operating	B-General_Concept
system	I-General_Concept
itself	O
be	O
prevented	O
from	O
writing	O
to	O
read-only	O
pages	O
(	O
through	O
the	O
setting	O
of	O
a	O
global	O
processor	B-Architecture
flag	O
)	O
,	O
and	O
not	O
all	O
kernels	O
are	O
designed	O
this	O
way	O
;	O
more	O
recent	O
kernels	O
in	O
fact	O
are	O
,	O
since	O
this	O
is	O
the	O
same	O
basic	O
mechanism	O
used	O
for	O
implementing	O
copy-on-write	B-Language
.	O
</s>
<s>
Additional	O
workarounds	B-Application
other	O
than	O
the	O
official	O
ones	O
from	O
Intel	O
have	O
been	O
proposed	O
;	O
in	O
many	O
cases	O
these	O
proved	O
as	O
effective	O
and	O
much	O
easier	O
to	O
implement	O
.	O
</s>
<s>
Again	O
,	O
the	O
extra	O
memory	O
cycles	O
that	O
the	O
processor	B-Architecture
was	O
forced	O
to	O
go	O
through	O
to	O
fetch	O
data	O
from	O
RAM	O
every	O
time	O
it	O
needed	O
to	O
invoke	O
an	O
exception	B-General_Concept
handler	I-General_Concept
appeared	O
to	O
be	O
all	O
that	O
was	O
needed	O
to	O
prevent	O
the	O
processor	B-Architecture
from	O
locking	O
up	O
.	O
</s>
<s>
In	O
this	O
case	O
,	O
no	O
modification	O
whatsoever	O
to	O
any	O
exception	B-General_Concept
handler	I-General_Concept
was	O
required	O
.	O
</s>
<s>
For	O
unknown	O
reasons	O
,	O
these	O
additional	O
,	O
unofficial	O
workarounds	B-Application
were	O
never	O
endorsed	O
by	O
Intel	O
.	O
</s>
<s>
It	O
might	O
be	O
that	O
it	O
was	O
suspected	O
that	O
they	O
might	O
not	O
work	O
with	O
all	O
affected	O
processor	B-Architecture
versions	O
.	O
</s>
