Received: from mail.onstor.com (66.201.51.107) by exch1.onstor.net
 (10.0.0.225) with Microsoft SMTP Server id 8.1.311.2; Tue, 5 May 2009
 12:52:05 -0700
Received: from psmtp.com ([64.18.0.63]) by mail.onstor.com with Microsoft
 SMTPSVC(6.0.3790.3959);	 Tue, 5 May 2009 12:52:05 -0700
Received: from source ([213.58.128.207]) by exprod5mx204.postini.com
 ([64.18.4.13]) with SMTP;	Tue, 05 May 2009 15:52:05 EDT
Received: from localhost.localdomain ([127.0.0.1]:36045 "EHLO
	ftp.linux-mips.org" rhost-flags-OK-OK-OK-FAIL) by ftp.linux-mips.org	with
 ESMTP id S20023668AbZEETvr (ORCPT	<rfc822;andy.sharp@onstor.com>); Tue, 5 May
 2009 20:51:47 +0100
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 05 May 2009 20:51:30
 +0100 (BST)
Received: from mail3.caviumnetworks.com ([12.108.191.235]:29386 "EHLO
	mail3.caviumnetworks.com" rhost-flags-OK-OK-OK-OK)	by ftp.linux-mips.org with
 ESMTP id S20023658AbZEETvY (ORCPT	<rfc822;linux-mips@linux-mips.org>); Tue, 5
 May 2009 20:51:24 +0100
Received: from exch4.caveonetworks.com (Not Verified[192.168.16.23]) by
 mail3.caviumnetworks.com with MailMarshal (v6,2,2,3503)	id <B4a00988e0008>;
 Tue, 05 May 2009 15:50:38 -0400
Received: from exch4.caveonetworks.com ([192.168.16.23]) by
 exch4.caveonetworks.com with Microsoft SMTPSVC(6.0.3790.3959);	 Tue, 5 May
 2009 12:49:51 -0700
Received: from dd1.caveonetworks.com ([64.169.86.201]) by
 exch4.caveonetworks.com over TLS secured channel with Microsoft
 SMTPSVC(6.0.3790.3959);	 Tue, 5 May 2009 12:49:51 -0700
Received: from dd1.caveonetworks.com (localhost.localdomain [127.0.0.1])	by
 dd1.caveonetworks.com (8.14.2/8.14.2) with ESMTP id n45Jnmve000688;	Tue, 5
 May 2009 12:49:49 -0700
Received: (from ddaney@localhost)	by dd1.caveonetworks.com
 (8.14.2/8.14.2/Submit) id n45JnlnU000686;	Tue, 5 May 2009 12:49:47 -0700
From: David Daney <ddaney@caviumnetworks.com>
To: "linux-mips@linux-mips.org" <linux-mips@linux-mips.org>,
	"ralf@linux-mips.org" <ralf@linux-mips.org>, "florian@openwrt.org"
	<florian@openwrt.org>
CC: David Daney <ddaney@caviumnetworks.com>
Sender: "linux-mips-bounce@linux-mips.org" <linux-mips-bounce@linux-mips.org>
Date: Tue, 5 May 2009 12:49:47 -0700
Subject: [PATCH] MIPS: Use force_sig when handling address errors.
Thread-Topic: [PATCH] MIPS: Use force_sig when handling address errors.
Thread-Index: AcnNuvfWrxemTIlSTZCZaxdF4Mk+/A==
Message-ID: <1241552987-662-1-git-send-email-ddaney@caviumnetworks.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Exchange-Organization-AuthAs: Internal
X-MS-Exchange-Organization-AuthMechanism: 0b
X-MS-Exchange-Organization-AuthSource: exch1.onstor.net
X-MS-Has-Attach:
X-Auto-Response-Suppress: All
X-MS-TNEF-Correlator:
x-originalarrivaltime: 05 May 2009 19:49:51.0409 (UTC)
 FILETIME=[A778C210:01C9CDBA]
x-ems-stamp: NSXW7p1xVHlksnWSpAZohQ==
x-ems-proccessed: 2K3Xl1OQTInXD6xxuA8z3Q==
errors-to: linux-mips-bounce@linux-mips.org
x-pstn-neptune: 1/1/1.00/94
x-pstn-levels: (S:73.62430/99.90000 CV:99.9000 FC:95.5390 LC:95.5390
 R:95.9108 P:95.9108 M:97.0282 C:98.6951 )
x-list: linux-mips
x-archive-position: 22626
x-ecartis-version: Ecartis v1.0.0
x-original-sender: ddaney@caviumnetworks.com
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0

When init is started it is SIGNAL_UNKILLABLE.  If it were to get an
address error, we would try to send it SIGBUS, but it would be ignored
and the faulting instruction restarted.  This results in an endless
loop.

We need to use force_sig() instead so it will actually die and give us
some useful information.

Reported-by: Florian Fainelli <florian@openwrt.org>

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
---
 arch/mips/kernel/unaligned.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/mips/kernel/unaligned.c b/arch/mips/kernel/unaligned.c
index bf4c4a9..67bd626 100644
--- a/arch/mips/kernel/unaligned.c
+++ b/arch/mips/kernel/unaligned.c
@@ -482,19 +482,19 @@ fault:
 		return;
=20
 	die_if_kernel("Unhandled kernel unaligned access", regs);
-	send_sig(SIGSEGV, current, 1);
+	force_sig(SIGSEGV, current);
=20
 	return;
=20
 sigbus:
 	die_if_kernel("Unhandled kernel unaligned access", regs);
-	send_sig(SIGBUS, current, 1);
+	force_sig(SIGBUS, current);
=20
 	return;
=20
 sigill:
 	die_if_kernel("Unhandled kernel unaligned access or invalid instruction",=
 regs);
-	send_sig(SIGILL, current, 1);
+	force_sig(SIGILL, current);
 }
=20
 asmlinkage void do_ade(struct pt_regs *regs)
--=20
1.6.0.6


