Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Dec 1998 16:38:21 +0100
From:      Eivind Eklund <eivind@yes.no>
To:        dg@root.com, Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru>
Cc:        freebsd-bugs@FreeBSD.ORG
Subject:   Re: mmap of large files
Message-ID:  <19981207163821.K13839@follo.net>
In-Reply-To: <199812020545.VAA03985@root.com>; from David Greenman on Tue, Dec 01, 1998 at 09:45:42PM -0800
References:  <199812020021.DAA00861@tejblum.dnttm.rssi.ru> <199812020545.VAA03985@root.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Dec 01, 1998 at 09:45:42PM -0800, David Greenman wrote:
> >Does the test
> >	if ((pos + size > (vm_offset_t)-PAGE_SIZE) ||
> >in the mmap syscall have any purpose, other than break mmap with 
> >pos > 4GB?
> 
>    I think the code is wrong. I think it should be (addr + size) and comparing
> against -PAGE_SIZE is probably also wrong - careful attention needs to be
> paid to rounding and overflow issues here. Needs more analysis.

	if ((pos > (vm_offset_t)-PAGE_SIZE || size > (vm_offset_t)-PAGE_SIZE - pos) ||

Overflow problem solved, assuming pos and size are unsigned (as they
should be).  Whether ignoring just the last page (ie, comparing
against -PAGE_SIZE) is correct or not is up to someone else.

Eivind.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19981207163821.K13839>