public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "David C. Hansen" <haveblue@us.ibm.com>
To: Dave Jones <davej@codemonkey.org.uk>
Cc: Linus Torvalds <torvalds@transmeta.COM>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] (3/3) stack overflow checking for x86
Date: 31 Oct 2002 14:08:34 -0800	[thread overview]
Message-ID: <1036102114.4155.272.camel@nighthawk> (raw)
In-Reply-To: <20021031213032.GA25685@suse.de>

On Thu, 2002-10-31 at 13:30, Dave Jones wrote:
> On Thu, Oct 31, 2002 at 11:20:52AM -0800, David C. Hansen wrote:
>  > * stack checking (3/3)
>  >    - use gcc's profiling features to check for stack overflows upon
>  >      entry to functions.
>  >    - Warn if the task goes over 4k.
>  >    - Panic if the stack gets within 512 bytes of overflowing.
>  >    - use kksymoops information, if available
>  > 
>  > This won't apply cleanly without the irqstack patch, but the conflict is
>  > easy to resolve.  It requires the thread_info cleanup.
> 
> I'm wondering about interaction between this patch and the
> already merged CONFIG_DEBUG_STACKOVERFLOW ?

The currently merged one is very, very simple, but relatively worthless.
There are no guarantees about catching an overflow, especially if it
happens in a long call chain _after_ do_IRQ with interrupts disabled.  
Ben's version checks on entrance to every function, making it _much_
more likely to be caught, even during an interrupt.  But, the currently
merged one doesn't have any strange compiler requirements, like adding
the -p option.

The irq stack patch would make the current check pretty worthless
because the check happens just after the switch to a fresh irqstack
would have happened.

But, if they both get in, it can be cleaned up later because even if
both are turned on, nothing will blow up.  
-- 
Dave Hansen
haveblue@us.ibm.com


  reply	other threads:[~2002-10-31 22:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-31 19:18 [PATCH] (1/3) cleanup thread info on x86 David C. Hansen
2002-10-31 19:20 ` [PATCH] (2/3) per-cpu interrupt stacks for x86 David C. Hansen
2002-10-31 19:20 ` [PATCH] (3/3) stack overflow checking " David C. Hansen
2002-10-31 21:30   ` Dave Jones
2002-10-31 22:08     ` David C. Hansen [this message]
2002-11-01 12:59     ` Alan Cox
2002-11-01 13:42       ` Dave Jones
  -- strict thread matches above, loose matches on Subject: below --
2002-10-18 22:07 Dave Hansen
2002-10-18 22:31 ` Dave Hansen
2002-10-18 22:48   ` Andreas Dilger

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=1036102114.4155.272.camel@nighthawk \
    --to=haveblue@us.ibm.com \
    --cc=davej@codemonkey.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.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