From f72c22e45e8f8fe78c7f793d983bee5bed63497e Mon Sep 17 00:00:00 2001 From: Richard Weinberger Date: Mon, 23 Sep 2013 17:38:02 +0200 Subject: um: Make stack trace reliable against kernel mode faults As UML uses an alternative signal stack we cannot use the current stack pointer for stack dumping if UML itself dies by SIGSEGV. To bypass this issue we save regs taken from mcontext in our segv handler into thread_struct and use these regs to obtain the stack pointer in show_stack(). Signed-off-by: Richard Weinberger --- arch/um/include/asm/processor-generic.h | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/um/include/asm') diff --git a/arch/um/include/asm/processor-generic.h b/arch/um/include/asm/processor-generic.h index c03cd5a0236..90469031297 100644 --- a/arch/um/include/asm/processor-generic.h +++ b/arch/um/include/asm/processor-generic.h @@ -21,6 +21,7 @@ struct mm_struct; struct thread_struct { struct task_struct *saved_task; struct pt_regs regs; + struct pt_regs *segv_regs; int singlestep_syscall; void *fault_addr; jmp_buf *fault_catcher; -- cgit v1.2.3-18-g5258 From a1850e9c7282db1c19a18093a945d5e84bfe7418 Mon Sep 17 00:00:00 2001 From: Richard Weinberger Date: Mon, 23 Sep 2013 17:38:03 +0200 Subject: um: Get rid of thread_struct->saved_task As we have a sane show_stack() now, we can drop the ->saved_task hack. Signed-off-by: Richard Weinberger --- arch/um/include/asm/processor-generic.h | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/um/include/asm') diff --git a/arch/um/include/asm/processor-generic.h b/arch/um/include/asm/processor-generic.h index 90469031297..d89b02bb626 100644 --- a/arch/um/include/asm/processor-generic.h +++ b/arch/um/include/asm/processor-generic.h @@ -19,7 +19,6 @@ struct task_struct; struct mm_struct; struct thread_struct { - struct task_struct *saved_task; struct pt_regs regs; struct pt_regs *segv_regs; int singlestep_syscall; -- cgit v1.2.3-18-g5258