Skip to content

Commit c6ef894

Browse files
Ingo MolnarKAGA-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 <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: Cyrill Gorcunov <[email protected]> Cc: [email protected] Cc: tip-bot for Jacob Shin <[email protected]> Link: http://lkml.kernel.org/r/[email protected]
1 parent 5878d5d commit c6ef894

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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)