mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] x86/traps: call cond_local_irq_disable before returning from exc_general_protection and math_error
@ 2021-04-08 17:28 Thomas Tai
  2021-04-08 17:28 ` [PATCH 2/2] arch/x86: arch/sparc: tools/perf: fix typos in comments Thomas Tai
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Thomas Tai @ 2021-04-08 17:28 UTC (permalink / raw)
  To: tglx, mingo, bp, x86
  Cc: sean.j.christopherson, luto, jarkko, bp, jethro,
	alexandre.chartre, linux-kernel, thomas.tai

This fixes commit 334872a09198 ("x86/traps: Attempt to fixup exceptions
in vDSO before signaling") which added return statements without calling
cond_local_irq_disable(). According to commit ca4c6a9858c2
("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.

Signed-off-by: Thomas Tai <thomas.tai@oracle.com>
---
 arch/x86/kernel/traps.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index ac1874a..651e3e5 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -556,7 +556,7 @@ static enum kernel_gp_hint get_kernel_gp_address(struct pt_regs *regs,
 		tsk->thread.trap_nr = X86_TRAP_GP;
 
 		if (fixup_vdso_exception(regs, X86_TRAP_GP, error_code, 0))
-			return;
+			goto exit;
 
 		show_signal(tsk, SIGSEGV, "", desc, regs, error_code);
 		force_sig(SIGSEGV);
@@ -1057,7 +1057,7 @@ static void math_error(struct pt_regs *regs, int trapnr)
 		goto exit;
 
 	if (fixup_vdso_exception(regs, trapnr, 0, 0))
-		return;
+		goto exit;
 
 	force_sig_fault(SIGFPE, si_code,
 			(void __user *)uprobe_get_trap_addr(regs));
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-04-09 13:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-08 17:28 [PATCH 1/2] x86/traps: call cond_local_irq_disable before returning from exc_general_protection and math_error Thomas Tai
2021-04-08 17:28 ` [PATCH 2/2] arch/x86: arch/sparc: tools/perf: fix typos in comments Thomas Tai
2021-04-09  9:09   ` Alexandre Chartre
2021-04-09  9:06 ` [PATCH 1/2] x86/traps: call cond_local_irq_disable before returning from exc_general_protection and math_error Alexandre Chartre
2021-04-09 13:08   ` Thomas Tai
2021-04-09 11:53 ` [tip: x86/urgent] x86/traps: Correct exc_general_protection() and math_error() return paths tip-bot2 for Thomas Tai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®