Software Assurance Reference Dataset

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 11 10:28:38 PDT 2014


On Monday, 30 June 2014 at 08:00:37 UTC, Ola Fosheim Grøstad
wrote:
> On Thursday, 26 June 2014 at 09:35:20 UTC, Walter Bright wrote:
>> Stack overflows are not safety problems when a guard page is 
>> used past the end of the stack. Then, overflow checking is 
>> done in hardware. Guard pages aren't currently used for 
>> fibers, so overflows are a real danger there.
>
> But a page is only 2K? So what happens if you skip more than 2K 
> and never touch the guard page? Does D prove that the stack 
> pointer is never moved more than 2K-1 without a read or write 
> in that range?
>

The compiler can ensure that you hit at least every 4k or so. It
doesn't look like a very hard constraint to have a volatile load
per untouched 4k of stack (which should be very rare).


More information about the Digitalmars-d mailing list