aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mm.h
diff options
context:
space:
mode:
authorPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>2005-09-21 12:55:39 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-21 13:11:55 -0400
commit7e2cff42cfac27c25202648c5c89f9171e5bc085 (patch)
tree5579fa13b1fc8081201f05d687e6dc795d9d648f /include/linux/mm.h
parent7e871b6c8f1f4fda41e51ef86147facecac3be9f (diff)
[PATCH] mm: add a note about partially hardcoded VM_* flags
Hugh made me note this line for permission checking in mprotect(): if ((newflags & ~(newflags >> 4)) & 0xf) { after figuring out what's that about, I decided it's nasty enough. Btw Hugh itself didn't like the 0xf. We can safely change it to VM_READ|VM_WRITE|VM_EXEC because we never change VM_SHARED, so no need to check that. Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Acked-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r--include/linux/mm.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 0d94c94d9d81..097b3a3c693d 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -136,6 +136,7 @@ extern unsigned int kobjsize(const void *objp);
136#define VM_EXEC 0x00000004 136#define VM_EXEC 0x00000004
137#define VM_SHARED 0x00000008 137#define VM_SHARED 0x00000008
138 138
139/* mprotect() hardcodes VM_MAYREAD >> 4 == VM_READ, and so for r/w/x bits. */
139#define VM_MAYREAD 0x00000010 /* limits for mprotect() etc */ 140#define VM_MAYREAD 0x00000010 /* limits for mprotect() etc */
140#define VM_MAYWRITE 0x00000020 141#define VM_MAYWRITE 0x00000020
141#define VM_MAYEXEC 0x00000040 142#define VM_MAYEXEC 0x00000040