Re: [PATCH] (3/3) stack overflow checking for x86

David C. Hansen (haveblue@us.ibm.com)
31 Oct 2002 14:08:34 -0800


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

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/