Re: kernel stack torture

Ulrich Windl (Ulrich.Windl@rz.uni-regensburg.de)
Fri, 16 Feb 1996 09:00:13 +0100


On 15 Feb 96 at 21:53, David S. Miller wrote:

> From: "Ulrich Windl" <Ulrich.Windl@rz.uni-regensburg.de>
> Date: Thu, 15 Feb 1996 08:35:49 +0100
>
> Wouldn't it be best to grwo the kernel stack instead of panic-ing?
> I don't know it this is easy, but it sounds a good idea. One could
> also watch how much kernel stack is actually used.
>
> Yes, growing the stack would be really neat. It would require
> implementing a unmapped page before each and every stack page, I

Isn't the stack for i386 located in the stack segment which has its
own size limit. I imagine that a stack overflow will be detected by
hardware (i886), causes a trap, and then the stack grows. This would
require that the kernel uses virtual addresses. I'm not sure about
this.

> implement this currently on the Sparc using the
> alloc/free_kernel_stack() interfaces I wrote for this very purpose.
> Currently on the ix86 the kernel stack pages live and breathe right in
> the middle of the free page pool, so when you overflow you most likely
> will spam a task_struct or a vfs buffer or a real process page without
> any immediate signs of what has happened.
>
> Later,
> David S. Miller
> davem@caip.rutgers.edu
>