This is the mail archive of the
mailing list for the GCC project.
Re: MMAP issue on cygwin
- From: Zack Weinberg <zack at codesourcery dot com>
- To: Florian Weimer <fw at deneb dot enyo dot de>
- Cc: Neil Booth <neil at daikokuya dot demon dot co dot uk>, gcc at gcc dot gnu dot org
- Date: Tue, 1 Jan 2002 11:11:13 -0800
- Subject: Re: MMAP issue on cygwin
- References: <20011219074114.A4605@daikokuya.demon.co.uk> <firstname.lastname@example.org>
On Fri, Dec 28, 2001 at 11:13:29AM +0100, Florian Weimer wrote:
> Neil Booth <email@example.com> 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.