Skip to content

Commit 632a1c2

Browse files
thomastaioraclesuryasaimadhu
authored andcommitted
x86/traps: Correct exc_general_protection() and math_error() return paths
Commit 334872a ("x86/traps: Attempt to fixup exceptions in vDSO before signaling") added return statements which bypass calling cond_local_irq_disable(). According to ca4c6a9 ("x86/traps: Make interrupt enable/disable symmetric in C code"), cond_local_irq_disable() is needed because the asm return code no longer disables interrupts. Follow the existing code as an example to use "goto exit" instead of "return" statement. [ bp: Massage commit message. ] Fixes: 334872a ("x86/traps: Attempt to fixup exceptions in vDSO before signaling") Signed-off-by: Thomas Tai <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Reviewed-by: Alexandre Chartre <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 3a62583 commit 632a1c2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/kernel/traps.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ DEFINE_IDTENTRY_ERRORCODE(exc_general_protection)
556556
tsk->thread.trap_nr = X86_TRAP_GP;
557557

558558
if (fixup_vdso_exception(regs, X86_TRAP_GP, error_code, 0))
559-
return;
559+
goto exit;
560560

561561
show_signal(tsk, SIGSEGV, "", desc, regs, error_code);
562562
force_sig(SIGSEGV);
@@ -1057,7 +1057,7 @@ static void math_error(struct pt_regs *regs, int trapnr)
10571057
goto exit;
10581058

10591059
if (fixup_vdso_exception(regs, trapnr, 0, 0))
1060-
return;
1060+
goto exit;
10611061

10621062
force_sig_fault(SIGFPE, si_code,
10631063
(void __user *)uprobe_get_trap_addr(regs));

0 commit comments

Comments
 (0)