From: Eric Sandeen <sandeen@sandeen.net>
To: Ingo Molnar <mingo@elte.hu>
Cc: Eric Sandeen <sandeen@redhat.com>,
linux-kernel Mailing List <linux-kernel@vger.kernel.org>,
Arjan van de Ven <arjan@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] use canary at end of stack to indicate overruns at oops time
Date: Tue, 22 Apr 2008 11:44:12 -0500 [thread overview]
Message-ID: <480E15DC.5040301@sandeen.net> (raw)
In-Reply-To: <20080422084404.GA2388@elte.hu>
Ingo Molnar wrote:
> * Eric Sandeen <sandeen@redhat.com> wrote:
>> With the code in place, an intentionally-bloated stack oops does:
>>
>> BUG: unable to handle kernel paging request at ffff8103f84cc680
>> IP: [<ffffffff810253df>] update_curr+0x9a/0xa8
>> PGD 8063 PUD 0
>> Thread overran stack or stack corrupted
>> Oops: 0000 [1] SMP
>> CPU 0
>> ...
>
> excellent. I've queued this up, it's definitely an improvement in
> debuggability.
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
next prev parent reply other threads:[~2008-04-22 16:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-22 3:44 [PATCH] use canary at end of stack to indicate overruns at oops time Eric Sandeen
2008-04-22 4:20 ` Arjan van de Ven
2008-04-22 8:44 ` Ingo Molnar
2008-04-22 16:44 ` Eric Sandeen [this message]
2008-04-22 17:18 ` [PATCH] Fix max-stack calculators to skip canary Eric Sandeen
2008-04-22 17:33 ` Joe Perches
2008-04-22 18:09 ` Eric Sandeen
2008-04-28 17:28 ` Ingo Molnar
2008-04-22 21:38 ` [PATCH V2] use canary at end of stack to indicate overruns at oops time Eric Sandeen
2008-04-22 22:14 ` Harvey Harrison
2008-04-22 22:28 ` Eric Sandeen
2008-04-28 17:31 ` Ingo Molnar
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=480E15DC.5040301@sandeen.net \
--to=sandeen@sandeen.net \
--cc=akpm@linux-foundation.org \
--cc=arjan@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=sandeen@redhat.com \
/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