From 0ae8dceaebe3659ee0c3352c08125f403e77ebca Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Tue, 28 Sep 1999 22:25:29 +0000 Subject: Merge with 2.3.10. --- arch/i386/mm/fault.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'arch/i386/mm') diff --git a/arch/i386/mm/fault.c b/arch/i386/mm/fault.c index 5a1f363bd..c3e423b21 100644 --- a/arch/i386/mm/fault.c +++ b/arch/i386/mm/fault.c @@ -50,7 +50,8 @@ good_area: start &= PAGE_MASK; for (;;) { - handle_mm_fault(current,vma, start, 1); + if (handle_mm_fault(current, vma, start, 1) <= 0) + goto bad_area; if (!size) break; size--; @@ -162,8 +163,13 @@ good_area: * make sure we exit gracefully rather than endlessly redo * the fault. */ - if (!handle_mm_fault(tsk, vma, address, write)) - goto do_sigbus; + { + int fault = handle_mm_fault(tsk, vma, address, write); + if (fault < 0) + goto out_of_memory; + if (!fault) + goto do_sigbus; + } /* * Did it hit the DOS screen memory VA from vm86 mode? @@ -255,6 +261,13 @@ no_context: * We ran out of memory, or some other thing happened to us that made * us unable to handle the page fault gracefully. */ +out_of_memory: + up(&mm->mmap_sem); + printk("VM: killing process %s\n", tsk->comm); + if (error_code & 4) + do_exit(SIGKILL); + goto no_context; + do_sigbus: up(&mm->mmap_sem); -- cgit v1.2.3