This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: MMAP issue on cygwin


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]