Re: [PATCH] use canary at end of stack to indicate overruns at oops time

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Eric Sandeen
Date: Tuesday, April 22, 2008 - 9:44 am

Ingo Molnar wrote:


Crud, just realized this probably doesn't play well with
CONFIG_DEBUG_STACK_USAGE.  I think it will need something like:

Index: linux-2.6.25-rc7/kernel/exit.c
===================================================================
--- linux-2.6.25-rc7.orig/kernel/exit.c	2008-04-20 22:34:16.000000000 -0500
+++ linux-2.6.25-rc7/kernel/exit.c	2008-04-22 11:38:05.769412824 -0500
@@ -826,6 +826,8 @@ static void check_stack_usage(void)
 	unsigned long *n = end_of_stack(current);
 	unsigned long free;

+	n++;	/* skip over canary at end */
+
 	while (*n == 0)
 		n++;
 	free = (unsigned long)n - (unsigned long)end_of_stack(current);


Testing now... want me to resend the whole patch, Ingo, or you want to
just fix it up?  (I'll follow up with the testing results)

Thanks,
-Eric
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] use canary at end of stack to indicate overrun ..., Eric Sandeen, (Tue Apr 22, 9:44 am)
[PATCH] Fix max-stack calculators to skip canary, Eric Sandeen, (Tue Apr 22, 10:18 am)
Re: [PATCH] Fix max-stack calculators to skip canary, Joe Perches, (Tue Apr 22, 10:33 am)
Re: [PATCH] Fix max-stack calculators to skip canary, Eric Sandeen, (Tue Apr 22, 11:09 am)
Re: [PATCH] Fix max-stack calculators to skip canary, Ingo Molnar, (Mon Apr 28, 10:28 am)