fault.c (38fd2c202a3d82bc12430bce5789fa2c2a406f71) fault.c (c026b3591e4f2a4993df773183704bb31634e0bd)
1/*
2 * Copyright (C) 1995 Linus Torvalds
3 * Copyright (C) 2001, 2002 Andi Kleen, SuSE Labs.
4 * Copyright (C) 2008-2009, Red Hat Inc., Ingo Molnar
5 */
6#include <linux/magic.h> /* STACK_END_MAGIC */
7#include <linux/sched.h> /* test_thread_flag(), ... */
8#include <linux/kdebug.h> /* oops_begin/end, ... */

--- 627 unchanged lines hidden (view full) ---

636{
637 struct task_struct *tsk = current;
638 unsigned long *stackend;
639 unsigned long flags;
640 int sig;
641
642 /* Are we prepared to handle this kernel fault? */
643 if (fixup_exception(regs)) {
1/*
2 * Copyright (C) 1995 Linus Torvalds
3 * Copyright (C) 2001, 2002 Andi Kleen, SuSE Labs.
4 * Copyright (C) 2008-2009, Red Hat Inc., Ingo Molnar
5 */
6#include <linux/magic.h> /* STACK_END_MAGIC */
7#include <linux/sched.h> /* test_thread_flag(), ... */
8#include <linux/kdebug.h> /* oops_begin/end, ... */

--- 627 unchanged lines hidden (view full) ---

636{
637 struct task_struct *tsk = current;
638 unsigned long *stackend;
639 unsigned long flags;
640 int sig;
641
642 /* Are we prepared to handle this kernel fault? */
643 if (fixup_exception(regs)) {
644 /*
645 * Any interrupt that takes a fault gets the fixup. This makes
646 * the below recursive fault logic only apply to a faults from
647 * task context.
648 */
649 if (in_interrupt())
650 return;
651
652 /*
653 * Per the above we're !in_interrupt(), aka. task context.
654 *
655 * In this case we need to make sure we're not recursively
656 * faulting through the emulate_vsyscall() logic.
657 */
644 if (current_thread_info()->sig_on_uaccess_error && signal) {
645 tsk->thread.trap_nr = X86_TRAP_PF;
646 tsk->thread.error_code = error_code | PF_USER;
647 tsk->thread.cr2 = address;
648
649 /* XXX: hwpoison faults will set the wrong code. */
650 force_sig_info_fault(signal, si_code, address, tsk, 0);
651 }
658 if (current_thread_info()->sig_on_uaccess_error && signal) {
659 tsk->thread.trap_nr = X86_TRAP_PF;
660 tsk->thread.error_code = error_code | PF_USER;
661 tsk->thread.cr2 = address;
662
663 /* XXX: hwpoison faults will set the wrong code. */
664 force_sig_info_fault(signal, si_code, address, tsk, 0);
665 }
666
667 /*
668 * Barring that, we can do the fixup and be happy.
669 */
652 return;
653 }
654
655 /*
656 * 32-bit:
657 *
658 * Valid to do another page fault here, because if this fault
659 * had been triggered by is_prefetch fixup_exception would have

--- 598 unchanged lines hidden ---
670 return;
671 }
672
673 /*
674 * 32-bit:
675 *
676 * Valid to do another page fault here, because if this fault
677 * had been triggered by is_prefetch fixup_exception would have

--- 598 unchanged lines hidden ---