x86 set_signal: panic if interrupt came from kernel

This makes debugging errors e.g. FPE from kernel much easier,
we really shouldn't be taking a user level coredump blaming user
in that case anyway
This commit is contained in:
Dominique Martinet
2017-10-06 14:12:39 +09:00
parent d4cd756a91
commit 217dd9c1e5

View File

@@ -1337,8 +1337,12 @@ set_signal(int sig, void *regs0, siginfo_t *info)
if (thread == NULL || thread->proc->pid == 0) if (thread == NULL || thread->proc->pid == 0)
return; return;
if((__sigmask(sig) & thread->sigmask.__val[0]) || if (!interrupt_from_user(regs)) {
(regs->gpr.rsp & 0x8000000000000000)){ ihk_mc_debug_show_interrupt_context(regs);
panic("panic: kernel mode signal");
}
if ((__sigmask(sig) & thread->sigmask.__val[0])) {
coredump(thread, regs0); coredump(thread, regs0);
terminate(0, sig | 0x80); terminate(0, sig | 0x80);
} }