Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 156930
b: refs/heads/master
c: 28d7a6a
h: refs/heads/master
v: v3
  • Loading branch information
Graff Yang authored and Linus Torvalds committed Aug 18, 2009
1 parent 3805e69 commit b55c2d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 191529756633052680dd9d23ad63744ca5aa02a1
refs/heads/master: 28d7a6ae92c099d81cbea08c20be0d2cf7ccd7ca
4 changes: 4 additions & 0 deletions trunk/mm/nommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,10 @@ static int validate_mmap_request(struct file *file,
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) &&
Expand Down

0 comments on commit b55c2d4

Please sign in to comment.