linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Eric W. Biederman" <ebiederm@xmission.com>
To: linux-arch@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Vincent Chen <vincentc@andestech.com>,
	Greentime Hu <greentime@andestech.com>,
	Arnd Bergmann <arnd@arndb.de>
Subject: [REVIEW][PATCH 04/17] signal/nds32: Use force_sig in unhandled_interruption and unhandled_exceptions
Date: Thu, 19 Apr 2018 20:03:55 -0500	[thread overview]
Message-ID: <20180420010408.24438-4-ebiederm@xmission.com> (raw)
In-Reply-To: <878t9ilmhv.fsf@xmission.com>

Neither unhandled_interrupt nor unhandled_exceptions fills in any of the
siginfo fields whend sending SIGKILL.  Further because it is SIGKILL
even if all of the fields were filled out appropriately it would be impossible
for the process to read any of the siginfo fields.  So simplfy things and
just use force_sig instead of force_sig_info.

Fixes: 2923f5ea7738 ("nds32: Exception handling")
Cc: Vincent Chen <vincentc@andestech.com>
Cc: Greentime Hu <greentime@andestech.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 arch/nds32/kernel/traps.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/arch/nds32/kernel/traps.c b/arch/nds32/kernel/traps.c
index 6e34eb9824a4..65961bf91d64 100644
--- a/arch/nds32/kernel/traps.c
+++ b/arch/nds32/kernel/traps.c
@@ -318,29 +318,22 @@ void do_debug_trap(unsigned long entry, unsigned long addr,
 
 void unhandled_interruption(struct pt_regs *regs)
 {
-	siginfo_t si;
 	pr_emerg("unhandled_interruption\n");
 	show_regs(regs);
 	if (!user_mode(regs))
 		do_exit(SIGKILL);
-	si.si_signo = SIGKILL;
-	si.si_errno = 0;
-	force_sig_info(SIGKILL, &si, current);
+	force_sig(SIGKILL, current);
 }
 
 void unhandled_exceptions(unsigned long entry, unsigned long addr,
 			  unsigned long type, struct pt_regs *regs)
 {
-	siginfo_t si;
 	pr_emerg("Unhandled Exception: entry: %lx addr:%lx itype:%lx\n", entry,
 		 addr, type);
 	show_regs(regs);
 	if (!user_mode(regs))
 		do_exit(SIGKILL);
-	si.si_signo = SIGKILL;
-	si.si_errno = 0;
-	si.si_addr = (void *)addr;
-	force_sig_info(SIGKILL, &si, current);
+	force_sig(SIGKILL, current);
 }
 
 extern int do_page_fault(unsigned long entry, unsigned long addr,
-- 
2.14.1

  parent reply	other threads:[~2018-04-20  1:03 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-20  1:01 [REVIEW][PATCH 00/17] siginfo bugfixes and cleanups Eric W. Biederman
2018-04-20  1:03 ` [REVIEW][PATCH 01/17] signal/alpha: Document a conflict with SI_USER for SIGFPE Eric W. Biederman
2018-04-20  1:03 ` [REVIEW][PATCH 02/17] sparc: fix compat siginfo ABI regression Eric W. Biederman
2018-04-20  1:03 ` [REVIEW][PATCH 03/17] signal/sh: Use force_sig_fault in hw_breakpoint_handler Eric W. Biederman
2018-04-20  1:03 ` Eric W. Biederman [this message]
2018-04-25 12:14   ` [REVIEW][PATCH 04/17] signal/nds32: Use force_sig in unhandled_interruption and unhandled_exceptions Vincent Chen
2018-04-20  1:03 ` [REVIEW][PATCH 05/17] signal/nds32: Use force_sig(SIGILL) in do_revisn Eric W. Biederman
2018-04-25 12:10   ` Vincent Chen
2018-04-25 16:13     ` [PATCH] signal/nds32: More information in do_revinsn Eric W. Biederman
2018-04-26  3:02       ` Vincent Chen
2018-04-20  1:03 ` [REVIEW][PATCH 06/17] signal: Ensure every siginfo we send has all bits initialized Eric W. Biederman
2018-04-20  1:03 ` [REVIEW][PATCH 07/17] signal: Reduce copy_siginfo_to_user to just copy_to_user Eric W. Biederman
2018-04-20  1:03 ` [REVIEW][PATCH 08/17] signal: Stop special casing TRAP_FIXME and FPE_FIXME in siginfo_layout Eric W. Biederman
2018-04-20  1:04 ` [REVIEW][PATCH 09/17] signal: Remove SEGV_BNDERR ifdefs Eric W. Biederman
2018-04-20  1:04 ` [REVIEW][PATCH 10/17] signal: Remove ifdefs for BUS_MCEERR_AR and BUS_MCEERR_AO Eric W. Biederman
2018-04-20  1:04 ` [REVIEW][PATCH 11/17] signal/alpha: Replace FPE_FIXME with FPE_FLTUNK Eric W. Biederman
2018-04-20  1:04 ` [REVIEW][PATCH 12/17] signal/ia64: " Eric W. Biederman
2018-04-20  1:04 ` [REVIEW][PATCH 13/17] signal/powerpc: " Eric W. Biederman
2018-04-20  1:04 ` [REVIEW][PATCH 14/17] signal/unicore32: Use FPE_FLTUNK instead of 0 in ucf64_raise_sigfpe Eric W. Biederman
2018-04-20  1:04 ` [REVIEW][PATCH 15/17] signal: Add TRAP_UNK si_code for undiagnosted trap exceptions Eric W. Biederman
2018-04-20  1:04 ` [REVIEW][PATCH 16/17] signal/alpha: Replace TRAP_FIXME with TRAP_UNK Eric W. Biederman
2018-04-20  1:04 ` [REVIEW][PATCH 17/17] signal/powerpc: " Eric W. Biederman

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=20180420010408.24438-4-ebiederm@xmission.com \
    --to=ebiederm@xmission.com \
    --cc=arnd@arndb.de \
    --cc=greentime@andestech.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vincentc@andestech.com \
    /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).