Subject: Re: kernel stack overflow on netbsd-1-6 branch
To: Frank van der Linden <fvdl@wasabisystems.com>
From: David Laight <david@l8s.co.uk>
List: port-i386
Date: 11/26/2002 14:37:30
> Putting the KSTACK_CHECK_DR0 on the 1.6 branch makes some sense.
> However, for -current it isn't needed anymore, and it should
> probably be removed.

Wouldn't it be better to trap at ((char *)(p->p_addr + 1) + slack)
without mapping any extra pages?

> What I did in -current is put an unmapped page below the kernel
> stack, and make sure that double faults are caught correctly

Is the kernel stack still mapped with the U area?
If not you waste the rest of the U area page unless the U area
is mapped to the top of the area - which I don't think it is.

I did wonder whether it was possible to map a single physical page
into the last page of kernel stack for every process.
This could be used by interrupts and (possibly) by deep call
sequences.  However you would panic on any attempt to sleep
with the sp in that page (and maybe any non-nested ISR).

Do we stack switch for ISRs anyway? I could grep for it...

	David

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