aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/kernel/trap_kern.c
diff options
context:
space:
mode:
authorPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>2005-09-10 13:44:57 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-10 15:00:18 -0400
commitd129f31236c241c07e583e8bc695c382365d02ce (patch)
tree53e6370fe8e3134f41d8b0c08d9af400ab9504eb /arch/um/kernel/trap_kern.c
parentd99c4022f60a9aa3a8dc6b7d71f3d0998c696912 (diff)
[PATCH] uml: fix fault handler on write
The UML fault handler was recently changed to enforce PROT_NONE protections, by requiring VM_READ or VM_EXEC on VMA's. However, by mistake, things were changed such that VM_READ is always checked, also on write faults; so a VMA mapped with only PROT_WRITE is not readable (unless it's prefaulted with MAP_POPULATE or with a write), which is different from i386. Discovered while testing remap_file_pages protection support. Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/kernel/trap_kern.c')
-rw-r--r--arch/um/kernel/trap_kern.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/um/kernel/trap_kern.c b/arch/um/kernel/trap_kern.c
index b5fc89fe9eab..d20361dcd127 100644
--- a/arch/um/kernel/trap_kern.c
+++ b/arch/um/kernel/trap_kern.c
@@ -57,7 +57,8 @@ good_area:
57 if(is_write && !(vma->vm_flags & VM_WRITE)) 57 if(is_write && !(vma->vm_flags & VM_WRITE))
58 goto out; 58 goto out;
59 59
60 if(!(vma->vm_flags & (VM_READ | VM_EXEC))) 60 /* Don't require VM_READ|VM_EXEC for write faults! */
61 if(!is_write && !(vma->vm_flags & (VM_READ | VM_EXEC)))
61 goto out; 62 goto out;
62 63
63 do { 64 do {