Skip to content

Commit

Permalink
[PATCH] uml: Page fault fixes
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff Dike authored and Linus Torvalds committed May 20, 2005
1 parent ba9950c commit 13479d5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions arch/um/kernel/trap_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)){
Expand Down

0 comments on commit 13479d5

Please sign in to comment.