MMAP issue on cygwin
Zack Weinberg
zack@codesourcery.com
Tue Jan 1 11:11:00 GMT 2002
On Fri, Dec 28, 2001 at 11:13:29AM +0100, Florian Weimer wrote:
> Neil Booth <neil@daikokuya.demon.co.uk> writes:
>
> > It would appear we've mmap-ed longlong.h, and that the bytes beyond
> > the end of the file are not NULs.
>
> This shouldn't matter. It is a bug to access data beyond the end of
> the file because the results are indeterministic.
You're mistaken. SUSv4 says
The system always zero-fills any partial page at the end of an
object. Further, the system never writes out any modified
portions of the last page of an object that are beyond its
end. References within the address range starting at pa and
continuing for len bytes to whole pages following the end of
an object result in delivery of a SIGBUS signal.
I haven't got a copy of the Austin revisions to look at, but I doubt
this would have changed.
If you think about it, it is a security hole to do anything else.
zw
More information about the Gcc
mailing list