mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 2/9] UML - Page fault fixes
@ 2005-05-18  4:20 Jeff Dike
  0 siblings, 0 replies; only message in thread
From: Jeff Dike @ 2005-05-18  4:20 UTC (permalink / raw)
  To: akpm, torvalds; +Cc: linux-kernel, user-mode-linux-devel

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>

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)){


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-05-18 12:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-18  4:20 [PATCH 2/9] UML - Page fault fixes Jeff Dike

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®