4 ms·
It has always made me wonder why there is no direct way for checking for overflow in most languages, since most CPUs do have an overflow flag. Dedicating an ope
by xiaq 12y ago
It has always made me wonder why there is no direct way for checking for overflow in most languages, since most CPUs do have an overflow flag. Dedicating an operator or keyword is probably too much, but at least it can be a routine in stdlib that usually gets inlined.
I have also come to think "hey this perhaps could be a security hole" every time it comes to unchecked overflow. Does anyone know such exploits?
- xiaq 12y agoReplying to myself: A little googling reveals that it actually is exploitable [1][2][3]. 1. http://stackoverflow.com/questions/2913618/how-is-integer-overflow-exploitable http://stackoverflow.com/questions/2913618/how-is-integer-ov... 2. http://rogunix.com/docs/Reversing&Exploiting/Detecting%20and%20exploiting%20integer%20overflows.pdf http://rogunix.com/docs/Reversing&Exploiting/Detecting%20and... 3. http://www.exploit-db.com/wp-content/themes/exploit/docs/28477.pdf http://www.exploit-db.com/wp-content/themes/exploit/docs/284...
- tlarkworthy 12y agoThe most amazing achievement of the computer software industry is its continuing cancellation of the steady and staggering gains made by the computer hardware industry. — Henry Petroski
- eliteraspberrie 12y agoA good example of an integer overflow leading to a vulnerability was the 2002 vulnerability in OpenSSH: http://www.openssh.com/txt/preauth.adv http://www.openssh.com/txt/preauth.adv