From 8db54c2637b1d79e99793231e0b0a9a381997932 Mon Sep 17 00:00:00 2001 From: NAKAMURA Gou Date: Tue, 3 Mar 2015 17:30:34 +0900 Subject: [PATCH] make GPE on CPL0 cause panic --- arch/x86/kernel/cpu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/kernel/cpu.c b/arch/x86/kernel/cpu.c index f2ddfa96..105c5f7c 100644 --- a/arch/x86/kernel/cpu.c +++ b/arch/x86/kernel/cpu.c @@ -615,6 +615,9 @@ void gpe_handler(struct x86_user_context *regs) kprintf("General protection fault (err: %lx, %lx:%lx)\n", regs->gpr.error, regs->gpr.cs, regs->gpr.rip); arch_show_interrupt_context(regs); + if ((regs->gpr.cs & 3) == 0) { + panic("gpe_handler"); + } set_signal(SIGSEGV, regs, NULL); check_signal(0, regs); check_need_resched();