Re: To all architecture maintainers: RFC: mmap2()

From: Jakub Jelinek (jakub@redhat.com)
Date: Sun Jan 09 2000 - 00:37:03 EST


On Sat, Jan 08, 2000 at 08:46:52PM +0000, Russell King wrote:
> Hi,
>
> Looking through the various implementations of mmap2(), it occurs that
> at least the sparc implementation is byggy.
>
> Sparc's mmap2() consists of:
>
> /* Make sure the shift for mmap2 is constant (12), no matter what PAGE_SIZE
> we have. */
> return do_mmap2(addr, len, prot, flags, fd, pgoff >> (PAGE_SHIFT - 12));
>
> What happens if you have an 8K page size (PAGE_SHIFT == 13), and the
> user supplies an odd number in pgoff?
>
> You are unable to represent the requested offset into the do_mmap2()
> call. Surely, in this case, mmap2() should return EINVAL.

Agreed completely. Will add checks for that both in sys_mmap2 and sys_mmap2
on sparc32.

Cheers,
    Jakub
___________________________________________________________________
Jakub Jelinek | jakub@redhat.com | http://sunsite.mff.cuni.cz/~jj
Linux version 2.3.36 on a sparc64 machine (1343.49 BogoMips)
___________________________________________________________________

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jan 15 2000 - 21:00:13 EST