aboutsummaryrefslogtreecommitdiff
path: root/mm/mprotect.c
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-09-23 19:03:21 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-09-23 19:03:21 -0400
commit536f8098026bde1368bbfcbcb9682a7637b73df2 (patch)
treecf83d2e1afa503b6aeba103b55cd1da0af4e7a4c /mm/mprotect.c
parente86ee6682b649183c11013a98be02f25e9ae399d (diff)
parent3fd07d3bf0077dcc0f5a33d2eb1938ea050da8da (diff)
Merge /spare/repo/linux-2.6/
Diffstat (limited to 'mm/mprotect.c')
-rw-r--r--mm/mprotect.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/mprotect.c b/mm/mprotect.c
index e9fbd013ad9..57577f63b30 100644
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -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;
}