Pentium F00F bug
|This article needs additional citations for verification. (May 2010)|
The invalid operand with locked CMPXCHG8B instruction bug, commonly referred to as the Pentium F00F bug (as shorthand for
F0 0F C7 C8, the hexadecimal encoding of one offending instruction), is a design flaw in the majority of Intel Pentium, Pentium MMX, and Pentium OverDrive processors (all in the P5 microarchitecture).
In the x86 architecture, the byte sequence
F0 0F C7 C8 represents the instruction
lock cmpxchg8b eax (locked compare and exchange of 8 bytes in register eax).
The operand could be a register other than eax.
This instruction encoding is invalid. The cmpxchg8b instruction compares the value in the edx and eax registers with an 8-byte value in a memory location. In this case, however, a register is used as the destination operand, which is not allowed.
Under normal circumstances, this instruction would simply result in an exception; however, when used with the lock prefix (normally used to prevent two processors from interfering with the same memory location), the CPU erroneously uses locked bus cycles to read exception handler descriptor. Locked reads without locked writes is not an allowed bus operation. After performing these bus cycles, all CPU activity stops, and it must be reset to recover.
The instruction does not require any special privileges and, due to the proliferation of Intel microprocessors, was considered a serious issue at the time. Operating system vendors responded by implementing workarounds that detected the condition and prevented the crash.
Although technically not an example of either, the F00F instruction is often considered an HCF instruction or a killer poke. Since the F00F bug has become common knowledge, the term is sometimes used to describe similar hardware design flaws such as the Cyrix coma bug.
No permanent hardware damage would result from executing the F00F instruction on a vulnerable system. Depending on the file system, operating system, and other circumstances, it is possible for data loss to occur if the disk buffers have not been flushed, if drives were interrupted during a write operation, or if some other non-atomic operation was interrupted.
Information about this bug first appeared on the Internet on or around 7 November 1997.
- Intel Pentium erratum
- Microsoft Knowledge Base article
- CNET Article
- The Pentium F00F Bug: Workarounds for a nasty problem provides a detailed description of the bug and possible workarounds.
- CVE-1999-1476, the Common Vulnerabilities and Exposures entry for the F00F bug