[PATCH 2/9] UML - Page fault fixes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]>

Index: linux-2.6.12-rc/arch/um/kernel/trap_kern.c
===================================================================
--- linux-2.6.12-rc.orig/arch/um/kernel/trap_kern.c	2005-05-17 16:34:45.000000000 -0400
+++ linux-2.6.12-rc/arch/um/kernel/trap_kern.c	2005-05-17 18:03:10.000000000 -0400
@@ -57,10 +57,11 @@ int handle_page_fault(unsigned long addr
 	*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)){

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux