Subject: Re: kernel stack overflow on netbsd-1-6 branch
To: SAITOH Masanobu <masanobu@iij.ad.jp>
From: David Laight <david@l8s.co.uk>
List: port-i386
Date: 11/26/2002 15:17:22
I think this might be the problem:

> +/* kernel stack params */
> +#ifndef NOREDZONE
> +/* override default for redzone */
> +#define	KSTACK_LOWEST_ADDR(p)	\
> +	((caddr_t)ALIGN((p)->p_addr + 1) + NBPG)
> +#define	KSTACK_SIZE	\
> +	(USPACE - NBPG*2)
> +#endif

You are only allowing 4k (1 page) for the kernel stack,
and KSTACK_SIZE will be zero (but probably isn't used).
(assuming USPACE is 2 pages).

There is about 7k of space before the stack hits the U area.
I'd give the kernel at least 6.5k before exploding.

	David

-- 
David Laight: david@l8s.co.uk