Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 9153
b: refs/heads/master
c: 7e2cff4
h: refs/heads/master
i:
  9151: 8640aa5
v: v3
  • Loading branch information
Paolo 'Blaisorblade' Giarrusso authored and Linus Torvalds committed Sep 21, 2005
1 parent 3be5917 commit 3b76aef
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 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: 7e871b6c8f1f4fda41e51ef86147facecac3be9f
refs/heads/master: 7e2cff42cfac27c25202648c5c89f9171e5bc085
1 change: 1 addition & 0 deletions trunk/include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ extern unsigned int kobjsize(const void *objp);
#define VM_EXEC 0x00000004
#define VM_SHARED 0x00000008

/* mprotect() hardcodes VM_MAYREAD >> 4 == VM_READ, and so for r/w/x bits. */
#define VM_MAYREAD 0x00000010 /* limits for mprotect() etc */
#define VM_MAYWRITE 0x00000020
#define VM_MAYEXEC 0x00000040
Expand Down
3 changes: 2 additions & 1 deletion trunk/mm/mprotect.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ sys_mprotect(unsigned long start, size_t len, unsigned long prot)

newflags = vm_flags | (vma->vm_flags & ~(VM_READ | VM_WRITE | VM_EXEC));

if ((newflags & ~(newflags >> 4)) & 0xf) {
/* newflags >> 4 shift VM_MAY% in place of VM_% */
if ((newflags & ~(newflags >> 4)) & (VM_READ | VM_WRITE | VM_EXEC)) {
error = -EACCES;
goto out;
}
Expand Down

0 comments on commit 3b76aef

Please sign in to comment.