Subject: Re: mmap wrapping around to 0 revisited

From: Dan Malek <[email-masked]>
Date: Tue, 05 Mar 2002 18:58:28 -0500

David Ashley wrote:

> .... The do_mmap itself is broken, the check
> for overflow is like this:
> 	if ((offset + PAGE_ALIGN(len)) < offset)
> 		goto out;
>
> It should be:
> 	if ((offset + PAGE_ALIGN(len)-1) < offset)
> 		goto out;

This has been fixed and broken over and over more times than
anything else in the kernel.  Anytime someone makes a generic VM
change you can bet this will be broken again.  The only people that
seem to care are those that want to map the last 4K page at the top
of the physical address space from a user application using mmap().
There aren't many of those people :-).

	-- Dan

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/