[Issue 17566] can use void initialization in @safe code to break out of stack

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jun 25 20:45:10 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=17566

Walter Bright <bugzilla at digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla at digitalmars.com

--- Comment #1 from Walter Bright <bugzilla at digitalmars.com> ---
The compiler should reject any stack frame that's larger than 4K. This is
because the operating system puts a guard page at the end of the reserved stack
area, and a seg fault in that region is caught by the OS and the reserved stack
area is increased.

But, if the access occurs beyond 4k, this doesn't happen. Worse, because of
stack arithmetic wraparound, any address becomes accessible.

--


More information about the Digitalmars-d-bugs mailing list