aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/fault.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-01-18 12:37:14 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-18 12:37:14 -0500
commitb2b062b8163391c42b3219d466ca1ac9742b9c7b (patch)
treef3f920c09b8de694b1bc1d4b878cfd2b0b98c913 /arch/x86/mm/fault.c
parenta9de18eb761f7c1c860964b2e5addc1a35c7e861 (diff)
parent99937d6455cea95405ac681c86a857d0fcd530bd (diff)
Merge branch 'core/percpu' into stackprotector
Conflicts: arch/x86/include/asm/pda.h arch/x86/include/asm/system.h Also, moved include/asm-x86/stackprotector.h to arch/x86/include/asm. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/mm/fault.c')
-rw-r--r--arch/x86/mm/fault.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 4c056b5d6a95..37242c405f16 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -535,7 +535,7 @@ static int vmalloc_fault(unsigned long address)
535 happen within a race in page table update. In the later 535 happen within a race in page table update. In the later
536 case just flush. */ 536 case just flush. */
537 537
538 pgd = pgd_offset(current->mm ?: &init_mm, address); 538 pgd = pgd_offset(current->active_mm, address);
539 pgd_ref = pgd_offset_k(address); 539 pgd_ref = pgd_offset_k(address);
540 if (pgd_none(*pgd_ref)) 540 if (pgd_none(*pgd_ref))
541 return -1; 541 return -1;
@@ -670,7 +670,6 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
670 if (unlikely(in_atomic() || !mm)) 670 if (unlikely(in_atomic() || !mm))
671 goto bad_area_nosemaphore; 671 goto bad_area_nosemaphore;
672 672
673again:
674 /* 673 /*
675 * When running in the kernel we expect faults to occur only to 674 * When running in the kernel we expect faults to occur only to
676 * addresses in user space. All other faults represent errors in the 675 * addresses in user space. All other faults represent errors in the
@@ -866,25 +865,14 @@ no_context:
866 oops_end(flags, regs, sig); 865 oops_end(flags, regs, sig);
867#endif 866#endif
868 867
869/*
870 * We ran out of memory, or some other thing happened to us that made
871 * us unable to handle the page fault gracefully.
872 */
873out_of_memory: 868out_of_memory:
869 /*
870 * We ran out of memory, call the OOM killer, and return the userspace
871 * (which will retry the fault, or kill us if we got oom-killed).
872 */
874 up_read(&mm->mmap_sem); 873 up_read(&mm->mmap_sem);
875 if (is_global_init(tsk)) { 874 pagefault_out_of_memory();
876 yield(); 875 return;
877 /*
878 * Re-lookup the vma - in theory the vma tree might
879 * have changed:
880 */
881 goto again;
882 }
883
884 printk("VM: killing process %s\n", tsk->comm);
885 if (error_code & PF_USER)
886 do_group_exit(SIGKILL);
887 goto no_context;
888 876
889do_sigbus: 877do_sigbus:
890 up_read(&mm->mmap_sem); 878 up_read(&mm->mmap_sem);