Linux PARISC architecture development
 help / color / mirror / Atom feed
From: Helge Deller <deller@gmx.de>
To: linux-parisc <linux-parisc@vger.kernel.org>,
	Kyle McMartin <kyle@mcmartin.ca>
Subject: [PATCH] fix crash when trying to unwind user space
Date: Sun, 24 Aug 2008 20:45:04 +0200	[thread overview]
Message-ID: <200808242045.04499.deller@gmx.de> (raw)
In-Reply-To: <200808242026.06295.deller@gmx.de>

Fix kernel to not to try to unwind functions when crash
happens in userspace.
Without this patch kernel may needlessly crash for userspace faults.

Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
Signed-off-by: Helge Deller <deller@gmx.de>

diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c
index 675f1d0..12276c8 100644
--- a/arch/parisc/kernel/traps.c
+++ b/arch/parisc/kernel/traps.c
@@ -121,18 +121,19 @@ static void print_fr(char *level, struct pt_regs *regs)
 
 void show_regs(struct pt_regs *regs)
 {
-	int i;
+	int i, user;
 	char *level;
 	unsigned long cr30, cr31;
 
-	level = user_mode(regs) ? KERN_DEBUG : KERN_CRIT;
+	user = user_mode(regs);
+	level = user ? KERN_DEBUG : KERN_CRIT;
 
 	print_gr(level, regs);
 
 	for (i = 0; i < 8; i += 4)
 		PRINTREGS(level, regs->sr, "sr", RFMT, i);
 
-	if (user_mode(regs))
+	if (user)
 		print_fr(level, regs);
 
 	cr30 = mfctl(30);
@@ -152,7 +153,8 @@ void show_regs(struct pt_regs *regs)
 	printk(level);
 	print_symbol(" RP(r2): %s\n", regs->gr[2]);
 
-	parisc_show_stack(current, NULL, regs);
+	if (!user)
+		parisc_show_stack(current, NULL, regs);
 }
 
 

  parent reply	other threads:[~2008-08-24 18:45 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-24 18:26 [PATCH] - Patch series for parisc Helge Deller
2008-08-24 18:33 ` [PATCH] compat_sys_ptrace conversions " Helge Deller
2008-08-25 16:52   ` Christoph Hellwig
2008-08-26 21:09     ` Roland McGrath
2008-08-25 17:11   ` Kyle McMartin
2008-08-25 17:49     ` Helge Deller
2008-08-26 20:03       ` Christoph Hellwig
2008-08-24 18:45 ` Helge Deller [this message]
2008-08-24 18:51 ` [PATCH] drop superfluous .align 16 Helge Deller
2008-08-24 18:57   ` James Bottomley
2008-08-25 12:31     ` Helge Deller
2008-08-26  4:26       ` Grant Grundler
2008-08-26 12:42         ` Carlos O'Donell
2008-08-26 14:10           ` James Bottomley
2008-08-26 15:35             ` Carlos O'Donell
2008-08-24 19:04 ` [PATCH] ldcw inline assembler patch Helge Deller
2008-08-24 19:21 ` [PATCH] Change cpu_data[] and cpu_devices[] from array sized by NR_CPUS to per_cpu variables Helge Deller
2008-08-24 21:24   ` Helge Deller
2008-08-27  4:51     ` Grant Grundler
2008-08-27 20:42       ` Helge Deller
2008-08-24 19:49 ` [PATCH] - Patch series for parisc Helge Deller

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=200808242045.04499.deller@gmx.de \
    --to=deller@gmx.de \
    --cc=kyle@mcmartin.ca \
    --cc=linux-parisc@vger.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