Title: [6939] branches/2009R1/mm/nommu.c: Fix bug [#5153], let ltp testcase mmap06,07 pass on branch
- Revision
- 6939
- Author
- gyang
- Date
- 2009-07-07 04:32:21 -0500 (Tue, 07 Jul 2009)
Log Message
Fix bug [#5153], let ltp testcase mmap06,07 pass on branch
Modified Paths
Diff
Modified: branches/2009R1/mm/nommu.c (6938 => 6939)
--- branches/2009R1/mm/nommu.c 2009-07-07 08:09:17 UTC (rev 6938)
+++ branches/2009R1/mm/nommu.c 2009-07-07 09:32:21 UTC (rev 6939)
@@ -773,6 +773,10 @@
if (!file->f_op->read)
capabilities &= ~BDI_CAP_MAP_COPY;
+ /* The file shall have been opened with read permission. */
+ if (!(file->f_mode & FMODE_READ))
+ return -EACCES;
+
if (flags & MAP_SHARED) {
/* do checks for writing, appending and locking */
if ((prot & PROT_WRITE) &&
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits