diff options
author | James Morris <jmorris@namei.org> | 2009-08-19 19:18:42 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2009-08-19 19:18:42 -0400 |
commit | ece13879e74313e62109e0755dd3d4f172df89e2 (patch) | |
tree | 1fe96ab392c1ff203a6fb3f67ed0ed577056572e /mm/nommu.c | |
parent | b08dc3eba0c34027010caeda258f495074ae3a54 (diff) | |
parent | 6c30c53fd5ae6a99a23ad78e90c428d2c8ffb07f (diff) |
Merge branch 'master' into next
Conflicts:
security/Kconfig
Manual fix.
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'mm/nommu.c')
-rw-r--r-- | mm/nommu.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mm/nommu.c b/mm/nommu.c index 28754c40be98..4bde489ec431 100644 --- a/mm/nommu.c +++ b/mm/nommu.c | |||
@@ -919,6 +919,10 @@ static int validate_mmap_request(struct file *file, | |||
919 | if (!file->f_op->read) | 919 | if (!file->f_op->read) |
920 | capabilities &= ~BDI_CAP_MAP_COPY; | 920 | capabilities &= ~BDI_CAP_MAP_COPY; |
921 | 921 | ||
922 | /* The file shall have been opened with read permission. */ | ||
923 | if (!(file->f_mode & FMODE_READ)) | ||
924 | return -EACCES; | ||
925 | |||
922 | if (flags & MAP_SHARED) { | 926 | if (flags & MAP_SHARED) { |
923 | /* do checks for writing, appending and locking */ | 927 | /* do checks for writing, appending and locking */ |
924 | if ((prot & PROT_WRITE) && | 928 | if ((prot & PROT_WRITE) && |