nommu: check fd read permission in validate_mmap_request()
authorGraff Yang <graff.yang@gmail.com>
Tue, 18 Aug 2009 21:11:17 +0000 (14:11 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 18 Aug 2009 23:31:13 +0000 (16:31 -0700)
commit28d7a6ae92c099d81cbea08c20be0d2cf7ccd7ca
tree7db56042d0c3e6749c749e1608b3e699485326cf
parent191529756633052680dd9d23ad63744ca5aa02a1
nommu: check fd read permission in validate_mmap_request()

According to the POSIX (1003.1-2008), the file descriptor shall have been
opened with read permission, regardless of the protection options specified to
mmap().  The ltp test cases mmap06/07 need this.

Signed-off-by: Graff Yang <graff.yang@gmail.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Greg Ungerer <gerg@snapgear.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/nommu.c