mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
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 <richard@nod.at>
This commit is contained in:
parent
9d1ee8ce92
commit
f72c22e45e
5 changed files with 44 additions and 12 deletions
|
@ -304,3 +304,11 @@ int set_signals(int enable)
|
|||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int os_is_signal_stack(void)
|
||||
{
|
||||
stack_t ss;
|
||||
sigaltstack(NULL, &ss);
|
||||
|
||||
return ss.ss_flags & SS_ONSTACK;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue