From owner-freebsd-hackers Fri Dec 1 9: 8:54 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.matriplex.com (ns1.matriplex.com [208.131.42.8]) by hub.freebsd.org (Postfix) with ESMTP id 5441637B400 for ; Fri, 1 Dec 2000 09:08:52 -0800 (PST) Received: from mail.matriplex.com (mail.matriplex.com [208.131.42.9]) by mail.matriplex.com (8.9.2/8.9.2) with ESMTP id JAA81324 for ; Fri, 1 Dec 2000 09:08:46 -0800 (PST) (envelope-from rh@matriplex.com) Date: Fri, 1 Dec 2000 09:08:46 -0800 (PST) From: Richard Hodges To: freebsd-hackers@FreeBSD.ORG Subject: Re: Per-process kernel stack size In-Reply-To: <200012010619.eB16JuF02371@mass.osd.bsdi.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, 30 Nov 2000, Mike Smith wrote: > > The routines have a nesting of 10-12 functions having 10-100 lines each. > > Could you tell us what is the minimum available run time memory in the > > per-process kernel stack for running these routines? > You can generally assume that you have about 4k of kernel stack (you will > normally have more, but don't count on it 8). I'm sure this is pretty obvious, and has already occured to most everyone else, but... Wouldn't it be a simple matter to set a global pointer to the stack base (lowest address) when switching context, so that the running code could know exactly how close it is to the limits? Maybe this would not be used in release code, but could be another tool for auditing suspicious code. Even better, maybe the stack could be set on a non-contiguous virtual address so that any overflow would trigger a fault? I would *much* rather have the machine grind to a halt with a relevant message than see mysterious data corruption. Of course, neither of these would be worthwhile once I stop writing code with bugs ;-) All the best, -Richard ------------------------------------------- Richard Hodges | Matriplex, inc. | 769 Basque Way rh@matriplex.com | Carson City, NV 89706 775-886-6477 | www.matriplex.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message