diff options
author | Jeff Dike <jdike@addtoit.com> | 2005-05-20 16:59:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-20 18:48:17 -0400 |
commit | 13479d52c7a61a18900d7f36730b7d3b43723d97 (patch) | |
tree | b8c23b0a7d06155ca7a8a7f5c0c55dbc5cbd870e | |
parent | ba9950c820e556e39cd26581826b5581a64fb641 (diff) |
[PATCH] uml: Page fault fixes
Any access to a PROT_NONE page should segfault the process. A JVM seems to do
this on purpose. Also, Al noticed some bogus code, which is now deleted.
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | arch/um/kernel/trap_kern.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/um/kernel/trap_kern.c b/arch/um/kernel/trap_kern.c index 5fca2c61eb98..9ae2eff0d8f3 100644 --- a/arch/um/kernel/trap_kern.c +++ b/arch/um/kernel/trap_kern.c | |||
@@ -57,10 +57,11 @@ int handle_page_fault(unsigned long address, unsigned long ip, | |||
57 | *code_out = SEGV_ACCERR; | 57 | *code_out = SEGV_ACCERR; |
58 | if(is_write && !(vma->vm_flags & VM_WRITE)) | 58 | if(is_write && !(vma->vm_flags & VM_WRITE)) |
59 | goto out; | 59 | goto out; |
60 | |||
61 | if(!(vma->vm_flags & (VM_READ | VM_EXEC))) | ||
62 | goto out; | ||
63 | |||
60 | page = address & PAGE_MASK; | 64 | page = address & PAGE_MASK; |
61 | pgd = pgd_offset(mm, page); | ||
62 | pud = pud_offset(pgd, page); | ||
63 | pmd = pmd_offset(pud, page); | ||
64 | do { | 65 | do { |
65 | survive: | 66 | survive: |
66 | switch (handle_mm_fault(mm, vma, address, is_write)){ | 67 | switch (handle_mm_fault(mm, vma, address, is_write)){ |