Re: stack overruns [was: Re: "Please HELP"-crash]

Alan Cox (alan@lxorguk.ukuu.org.uk)
Sun, 25 Apr 1999 18:00:09 +0100 (BST)


> 1) at system startup one huge block (16 kB per task slot, (8 kB stack +
> 8 kB guard pages)) is vm_alloc'ed. The area must be 8 kB aligned.

You can't vmalloc the stack without changing drivers that assume the stack
is DMAable. Thats a 2.3.x thing but yes. vmalloc I seem to remember already
does guard pages

> 2) if a task is created, then 2 single pages get allocated,
> and inserted into the vm_alloc'ed area.
> 3) the task_struct is moved to the end of the stack.
> (Windows 95 does it this way around)

The task struct is where it is in order to make dereferencing current
fast.

Alan

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