Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 39623
b: refs/heads/master
c: 80c5606
h: refs/heads/master
i:
  39621: d0c8679
  39619: 42edb23
  39615: 0c530ba
v: v3
  • Loading branch information
Linus Torvalds committed Oct 15, 2006
1 parent 977b1eb commit 78c6d9b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a7a0d86f5aa40a2215e36fe21d7911cf718ba428
refs/heads/master: 80c5606c3b45e0176c32d3108ade1e1cb0b954f3
21 changes: 10 additions & 11 deletions trunk/mm/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -900,17 +900,6 @@ unsigned long do_mmap_pgoff(struct file * file, unsigned long addr,
int accountable = 1;
unsigned long charged = 0, reqprot = prot;

if (file) {
if (is_file_hugepages(file))
accountable = 0;

if (!file->f_op || !file->f_op->mmap)
return -ENODEV;

if ((prot & PROT_EXEC) &&
(file->f_vfsmnt->mnt_flags & MNT_NOEXEC))
return -EPERM;
}
/*
* Does the application expect PROT_READ to imply PROT_EXEC?
*
Expand Down Expand Up @@ -1000,6 +989,16 @@ unsigned long do_mmap_pgoff(struct file * file, unsigned long addr,
case MAP_PRIVATE:
if (!(file->f_mode & FMODE_READ))
return -EACCES;
if (file->f_vfsmnt->mnt_flags & MNT_NOEXEC) {
if (vm_flags & VM_EXEC)
return -EPERM;
vm_flags &= ~VM_MAYEXEC;
}
if (is_file_hugepages(file))
accountable = 0;

if (!file->f_op || !file->f_op->mmap)
return -ENODEV;
break;

default:
Expand Down

0 comments on commit 78c6d9b

Please sign in to comment.