LWN.net Logo

Trapping on overflow

Trapping on overflow

Posted Feb 28, 2008 21:23 UTC (Thu) by anton (guest, #25547)
In reply to: Trapping on overflow by giraffedata
Parent article: vmsplice(): the making of a local root exploit

Apart from asm statements and modifying gcc I don't know of a way to get gcc or other compilers to use the trapping instructions for C code.

Concerning "no arithmetic in here is supposed to wrap around", unsigned arithmetic is supposed to wrap around in standard C, only signed arithmetic is allowed to trap (or do anything else) on overflow.


(Log in to post comments)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds