[Issue 9243] New: Order locals to prevent buffer overflow attacks

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Dec 29 17:37:35 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=9243

           Summary: Order locals to prevent buffer overflow attacks
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bugzilla at digitalmars.com


--- Comment #0 from Walter Bright <bugzilla at digitalmars.com> 2012-12-29 17:37:34 PST ---
The idea is to order the locals so that local static arrays are at higher
addresses than the pointer and integral locals. This prevents array overflows
from being able to rewrite those pointers (and integers that may be used as
array indices). This, of course, won't stop overwriting the return address, but
this enhancement has zero cost, so why not?

Yes, array overflow checking is done and would prevent buffer overflow attacks,
but this feature can be turned off for performance reasons.

Another idea is to use the return value as the "canary". Upon function entry,
copy the return value to a location on the other side of the arrays. Upon exit,
compare that with the original return value. If they differ, halt.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list