[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-parisc
Subject:    Re: [PATCH] fix unwind crash - was: Re: 2.6.26 kernel crash
From:       Kyle McMartin <kyle () mcmartin ! ca>
Date:       2008-08-06 19:41:25
Message-ID: 20080806194125.GA3281 () phobos ! i ! cabal ! ca
[Download message RAW]

On Sun, Aug 03, 2008 at 07:26:48AM -0700, Randolph Chung wrote:
> (Apologize for my earlier html mail - resent in a more proper format)
> 
> Helge, your patch doesn't look quite right.
> 
> The kernel unwinder is only supposed to be called for kernel
> addresses. Kyle says he thinks he knows what is wrong so he's going to
> poke at it.
> 
> Maybe we can make the kernel unwinder more robust against invalid
> addresses passed to it though.
> 

I think this will fix the problem, though I should audit show_stack
callers to make sure.

diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c
index 675f1d0..721d281 100644
--- a/arch/parisc/kernel/traps.c
+++ b/arch/parisc/kernel/traps.c
@@ -121,11 +121,12 @@ 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);
 
@@ -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);
 }
 
 
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic