linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "tip-bot2 for Thomas Tai" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Thomas Tai <thomas.tai@oracle.com>, Borislav Petkov <bp@suse.de>,
	Alexandre Chartre <alexandre.chartre@oracle.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/urgent] x86/traps: Correct exc_general_protection() and math_error() return paths
Date: Fri, 09 Apr 2021 11:53:42 -0000	[thread overview]
Message-ID: <161796922230.29796.17695217108171353828.tip-bot2@tip-bot2> (raw)
In-Reply-To: <1617902914-83245-1-git-send-email-thomas.tai@oracle.com>

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID:     632a1c209b8773cb0119fe3aada9f1db14fa357c
Gitweb:        https://git.kernel.org/tip/632a1c209b8773cb0119fe3aada9f1db14fa357c
Author:        Thomas Tai <thomas.tai@oracle.com>
AuthorDate:    Thu, 08 Apr 2021 13:28:33 -04:00
Committer:     Borislav Petkov <bp@suse.de>
CommitterDate: Fri, 09 Apr 2021 13:45:09 +02:00

x86/traps: Correct exc_general_protection() and math_error() return paths

Commit

  334872a09198 ("x86/traps: Attempt to fixup exceptions in vDSO before signaling")

added return statements which bypass calling cond_local_irq_disable().

According to

  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.

 [ bp: Massage commit message. ]

Fixes: 334872a09198 ("x86/traps: Attempt to fixup exceptions in vDSO before signaling")
Signed-off-by: Thomas Tai <thomas.tai@oracle.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Alexandre Chartre <alexandre.chartre@oracle.com>
Link: https://lkml.kernel.org/r/1617902914-83245-1-git-send-email-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 @@ DEFINE_IDTENTRY_ERRORCODE(exc_general_protection)
 		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));

      parent reply	other threads:[~2021-04-09 11:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-bot2 for Thomas Tai [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=161796922230.29796.17695217108171353828.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=alexandre.chartre@oracle.com \
    --cc=bp@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=thomas.tai@oracle.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).