A buffer overflow can occur in two cases: either when too much data are written to the buffer in RAM or when the latter proves to be too small. Good software manages the worst cases of buffer overflow and, in ideal cases, can catch all critical exceptions by changing the buffer size or denying some or all of the data headed for the buffer or by amending it.
The problem with a buffer overflow is that adjoining memory areas are overwritten. The very worst thing that can happen is when data content is not entirely "wiped" (segmentation fault), but is simply defective. You don't need to be told how quickly sequence errors snowball, and how difficult it is to analyze what went wrong after the event.
Overflowing a buffer by entering excessive values is not a cause for total disaster as only data are overwritten - the program running is elsewhere in the main memory. Hence a program has to be spirited in - the actual virus.
The whole thing gets perilous when local variables overflow. These are saved to that part of the memory called the stack, together with the return address of program to be executed. Once a hacker has figured out a way to deliberately create an overflow, he can change the return address at will and thus execute a program without the user's assent.
This becomes possible through a simple string function that copies the values in the stack from one address to another. No automatic check is made to verify whether the target address has enough space. The hacker can thus comfortably overwrite the adjoining return address as well.
You might say that malicious programs take up more space than a few Bytes or kiloBytes on the stack. In practice, however, this is all that's needed. Windows, after all, provides hundreds of service programs and function libraries (DLLs - Dynamic Link Libraries) that the virus is also free to abuse.
To nip these scenarios in the bud, blocking memory areas (return address) in the event of a buffer overflow is obviously an option. Microsoft, however, has yet to come up with the goods in this respect. Solaris or Linux, meanwhile, enabled NX long ago.
- More Speed, More Performance
- AMD Athlon64 FX-53
- AMD Athlon64 FX-53, Continued
- Which Boards For Socket 940 Allow Overclocking?
- Which Boards For Socket 940 Allow Overclocking? Continued
- 2.6 GHz Off The Bat
- DEP: Data Execution Protection
- Buffer Overflow: The Dangers
- Performance Tests: Not Without Hitches
- Errors In PC Mark 2004?
- Test System
- Benchmarks And Settings
- Benchmark Results
- SPECviewperf 7.1.1, Continued
- Wolfenstein Enemy Territory
- DirectX 8
- Splinter Cell
- DirectX 9
- X2 Demo
- Video Benchmarks
- XMPEG 5.0.3 / DivX 5.1.1 Pro
- Windows Media Encoder 9
- Audio Benchmarks
- Lame 3.95.1
- Application Benchmarks
- BAPCo SYSmark 2004, Continued
- Newtek Lightwave 7.5c
- Discreet 3DStudio MAX 6.0
- Microsoft - Visual Studio
- Synthetic Benchmarks
- SiSoft Sandra 2004 Pro