To all architecture maintainers: RFC: mmap2()

Russell King (rmk@arm.linux.org.uk)
Sat, 8 Jan 2000 20:46:52 +0000 (GMT)


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.

I haven't looked at all the architectures, but I know that ARM was
more buggy than this before tonight. ;)
_____
|_____| ------------------------------------------------- ---+---+-
| | Russell King rmk@arm.linux.org.uk --- ---
| | | | http://www.arm.linux.org.uk/~rmk/aboutme.html / / |
| +-+-+ --- -+-
/ | THE developer of ARM Linux |+| /|\
/ | | | --- |
+-+-+ ------------------------------------------------- /\\\ |

-
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/