| Integer Overflow |
Article Index for Integer |
Shopping Overflow |
Information AboutInteger Overflow |
| CATEGORIES ABOUT INTEGER OVERFLOW | |
| programming bugs | |
| security exploits | |
|
ORIGIN Integer numbers are frequently used in computer programs on all types of systems, since integer math operations are able to be executed quickly even on systems that do not have integrated Floating-point math capabilities. The size of the number able to be stored (and the size of the possible result) is based on the Register Width of the processor on which the code is to be executed. Common Binary sizes for integers include 8 bits, 16 bits, 32 bits (the most common width as of 2005), 64 bits, and 128 bits. Since a math operation may give a result larger than the available register width, an error condition may result. The or Big Endian ). This can also occur if the processor has a register width capable of storing the result, but the result is stored into a Variable that is too small to store the entire result. A third possibility is that a Signed Integer is being used. In such a case, the overflow could not only result in an incorrect value being returned, but that the value may be reported incorrectly as an unexpectedly negative or positive value. In this third case, one can define overflow to be the condition under which the addition of two positive integers (stored in Two's-complement format) produce a negative result, and likewise when the addition of two negative integers produce a positive result. The hardware on the CPU that detects this is rather simple; just a few logic gates can detect when the sign bit of the Addend s are the same, and when their value doesn't match the sign bit of the Sum . SECURITY RAMIFICATIONS Integer overflows do not generally lead to exploitable conditions. However, on systems where the result is simply stored, and no error is returned (this is the general case), it may not be possible for the software to determine that the value stored is erroneous. If an integer value is used to specify the location of other code or variable values in memory, the resulting Pointer error may be exploited to create a buffer overflow condition or to write and execute arbitrary (and possibly harmful) code to the resulting (and unexpected) position. SEE ALSO
EXTERNAL LINKS
|
|
|