Trapping on overflow
Posted Feb 23, 2008 21:45 UTC (Sat) by
anton (guest, #25547)
In reply to:
This code is there not for performance by giraffedata
Parent article:
vmsplice(): the making of a local root exploit
But I don't get why no CPU today provides even the option
of trapping on an arithmetic overflow.
MIPS and Alpha have separate arithmetic instructions that trap on
signed overflow (e.g., ADD on MIPS and ADDV on Alpha). IA-32 has INTO
which traps if OF is set. Apparently this instruction was so rarely
used by programmers, that AMD64 removed it in order to free up some
opcode space, and did not even bother to allocate another (multi-byte)
opcode for it; but you can still implement the functionality by
combining JO (or JNO) with INT.
The existence of INTO has not helped against this security hole, though.
(
Log in to post comments)