Re: [RESEND][PATCH] against mmap.c (do_mmap_pgoff) and a note

Jörn Engel
2003-06-16T11:20:04Z

On Mon, 16 June 2003 11:49:11 +0200, DervishD wrote:
> * Jörn Engel <joern@wohnheim.fh-wedel.de> dixit:
>
> > > return addr;
> > >
> > > - if (len > TASK_SIZE)
> > > - return -EINVAL;
> > > -
> > > len = PAGE_ALIGN(len);
> > >
> > > + if (len > TASK_SIZE || len == 0)
> > > + return -EINVAL;
> > > +
> >
> > PAGE_ALIGN(0) = 0
> > PAGE_ALIGN(1) = PAGE_SIZE
> >
> > Again, no change.
>
> There is a change in archs where TASK_SIZE is the entire
> addressable space (like sparc64). Ask Dave S., again. The problem did
> arise when TASK_SIZE is ~0. Then semantics change.

True. PAGE_ALIGN(-1) = 0 and that case would not get caught with the
old code. Looks good to me.

Jörn

--
Public Domain - Free as in Beer
General Public - Free as in Speech
BSD License - Free as in Enterprise
Shared Source - Free as in "Work will make you..."