]> err.no Git - linux-2.6/commitdiff
[PATCH] uml: Page fault fixes
authorJeff Dike <jdike@addtoit.com>
Fri, 20 May 2005 20:59:08 +0000 (13:59 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 20 May 2005 22:48:17 +0000 (15:48 -0700)
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>
arch/um/kernel/trap_kern.c

index 5fca2c61eb980a631fe70d500b18b9422e17e0cf..9ae2eff0d8f3fbb392ccaccb54249e9a0d99f8d2 100644 (file)
@@ -57,10 +57,11 @@ int handle_page_fault(unsigned long address, unsigned long ip,
        *code_out = SEGV_ACCERR;
        if(is_write && !(vma->vm_flags & VM_WRITE)) 
                goto out;
+
+        if(!(vma->vm_flags & (VM_READ | VM_EXEC)))
+                goto out;
+
        page = address & PAGE_MASK;
-       pgd = pgd_offset(mm, page);
-       pud = pud_offset(pgd, page);
-       pmd = pmd_offset(pud, page);
        do {
  survive:
                switch (handle_mm_fault(mm, vma, address, is_write)){