MIT Debuts Integer Overflow Debugger
msm1267 writes Students from M.I.T. have devised a new and more efficient way to scour raw code for integer overflows, the troublesome programming bugs that serve as a popular exploit vector for attackers and often lead to the crashing of systems. Researchers from the school's Computer Science and Artificial Intelligence Laboratory (CSAIL) last week debuted the platform dubbed DIODE, short for Directed Integer Overflow Detection. As part of an experiment, the researchers tested DIODE on code from five different open source applications. While the system was able to generate inputs that triggered three integer overflows that were previously known, the system also found 11 new errors. Four of the 11 overflows the team found are apparently still lingering in the wild, but the developers of those apps have been informed and CSAIL is awaiting confirmation of fixes.
Most processors will detect an integer overflow, and set a flag that can easily be checked for.
Sad to say, my own code probably has a huge number of them. I'd approximate it as:
(int)0xFFFF... with a bunch more F's
The one problem with their method is that it can only detect overflows in one direction.
Get free satoshi (Bitcoin) and Dogecoins
How about saying "Ah, some progress! Yay for progress! Now go make more progress!" instead of saying "You missed a spot."?
MIT already has an "integer overflow debugger" decades ago. It was called Lisp.
Ezekiel 23:20
gcc -ftrapv
gcc -fsanitize=undefined
-ftrapv hasn't worked since at least 2008.
Okay, research paid for with my tax dollars.
Where can I download it?
Or do these guys (and gals) think they're going to hide this away in a startup and try to get rich from it?
...they made a speedy, yet one-dimensional, fuzzer and christened it with a fancy acronym?
The first big problem with integers is that they are really badly defined in C, so just like you I try to use unsigned as much as possible:
Any underflow turns into a big overflow, so it can be tested for at the same time as the overflow test, and the semantics of power-of-two sized wraparound is pretty solid on all platforms and implementations.
OTOH I don't agree that having proper overflow handling would mostly be a new source of bugs, i.e. on the new Mill cpu architecture we have a full orthogonal set of of all basic operations:
When adding two numbers (belt values) you can specify signed or unsigned, and over/underflow to be handled as saturating, wraparound or trapping, as well as automatically widening.
http://millcomputing.com/wiki/...
Look at ADDSW as an example of a Signed ADD that will widen if needed.
Since the Mill carries metadata alongside each belt slot it does not need separate byte/short/word/dword ADD instructions: The size of the operations is defined by the belt slot specified and not in the instruction encoding, so the machine code is polymorphic in data item size.
I.e. you can start with 8-bit values and an 8-bit accumulator, when the sum becomes too large then it is automatically widened to 16 bits or more. This works all the way to 128 bits for all scalar operations.
Terje
"almost all programming can be viewed as an exercise in caching"
What's Mel Kaye's opinion about all this?
I ran this on my microcontroller code, and it found all sorts of these errors in all my timer and counter code. Now I have to go patch it all before any of those overflows happen. Thanks MIT!
India gives up nuclear weapons.