Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be5c2ff0 authored by Eric W. Biederman's avatar Eric W. Biederman
Browse files

signal/nds32: Use force_sig in unhandled_interruption and unhandled_exceptions



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: 2923f5ea ("nds32: Exception handling")
Cc: Vincent Chen <vincentc@andestech.com>
Cc: Greentime Hu <greentime@andestech.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Acked-by: default avatarVincent Chen <vincentc@andestech.com>
Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
parent 195bce73
Loading
Loading
Loading
Loading
+2 −9
Original line number Original line Diff line number Diff line
@@ -318,29 +318,22 @@ void do_debug_trap(unsigned long entry, unsigned long addr,


void unhandled_interruption(struct pt_regs *regs)
void unhandled_interruption(struct pt_regs *regs)
{
{
	siginfo_t si;
	pr_emerg("unhandled_interruption\n");
	pr_emerg("unhandled_interruption\n");
	show_regs(regs);
	show_regs(regs);
	if (!user_mode(regs))
	if (!user_mode(regs))
		do_exit(SIGKILL);
		do_exit(SIGKILL);
	si.si_signo = SIGKILL;
	force_sig(SIGKILL, current);
	si.si_errno = 0;
	force_sig_info(SIGKILL, &si, current);
}
}


void unhandled_exceptions(unsigned long entry, unsigned long addr,
void unhandled_exceptions(unsigned long entry, unsigned long addr,
			  unsigned long type, struct pt_regs *regs)
			  unsigned long type, struct pt_regs *regs)
{
{
	siginfo_t si;
	pr_emerg("Unhandled Exception: entry: %lx addr:%lx itype:%lx\n", entry,
	pr_emerg("Unhandled Exception: entry: %lx addr:%lx itype:%lx\n", entry,
		 addr, type);
		 addr, type);
	show_regs(regs);
	show_regs(regs);
	if (!user_mode(regs))
	if (!user_mode(regs))
		do_exit(SIGKILL);
		do_exit(SIGKILL);
	si.si_signo = SIGKILL;
	force_sig(SIGKILL, current);
	si.si_errno = 0;
	si.si_addr = (void *)addr;
	force_sig_info(SIGKILL, &si, current);
}
}


extern int do_page_fault(unsigned long entry, unsigned long addr,
extern int do_page_fault(unsigned long entry, unsigned long addr,