Skip to content

Commit c6ef894

Browse files
ingomolnarKAGA-KOKO
authored andcommitted
x86/idt: Fix the X86_TRAP_BP gate
Andrei Vagin reported a CRIU regression and bisected it back to: 90f6225 ("x86/idt: Move IST stack based traps to table init") This table init conversion loses the system-gate property of X86_TRAP_BP and erroneously moves it from DPL3 to DPL0. Fix it. Reported-by: Andrei Vagin <avagin@virtuozzo.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: dvlasenk@redhat.com Cc: linux-tip-commits@vger.kernel.org Cc: peterz@infradead.org Cc: brgerst@gmail.com Cc: rostedt@goodmis.org Cc: bp@alien8.de Cc: luto@kernel.org Cc: jpoimboe@redhat.com Cc: Cyrill Gorcunov <gorcunov@openvz.org> Cc: torvalds@linux-foundation.org Cc: tip-bot for Jacob Shin <tipbot@zytor.com> Link: http://lkml.kernel.org/r/20170901082630.xvyi5bwk6etmppqc@gmail.com
1 parent 5878d5d commit c6ef894

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎arch/x86/kernel/idt.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ struct idt_data {
4444
#define ISTG(_vector, _addr, _ist) \
4545
G(_vector, _addr, _ist, GATE_INTERRUPT, DPL0, __KERNEL_CS)
4646

47+
/* System interrupt gate with interrupt stack */
48+
#define SISTG(_vector, _addr, _ist) \
49+
G(_vector, _addr, _ist, GATE_INTERRUPT, DPL3, __KERNEL_CS)
50+
4751
/* Task gate */
4852
#define TSKG(_vector, _gdt) \
4953
G(_vector, NULL, DEFAULT_STACK, GATE_TASK, DPL0, _gdt << 3)
@@ -181,7 +185,7 @@ gate_desc debug_idt_table[IDT_ENTRIES] __page_aligned_bss;
181185
static const __initdata struct idt_data ist_idts[] = {
182186
ISTG(X86_TRAP_DB, debug, DEBUG_STACK),
183187
ISTG(X86_TRAP_NMI, nmi, NMI_STACK),
184-
ISTG(X86_TRAP_BP, int3, DEBUG_STACK),
188+
SISTG(X86_TRAP_BP, int3, DEBUG_STACK),
185189
ISTG(X86_TRAP_DF, double_fault, DOUBLEFAULT_STACK),
186190
#ifdef CONFIG_X86_MCE
187191
ISTG(X86_TRAP_MC, &machine_check, MCE_STACK),

0 commit comments

Comments
 (0)