From owner-freebsd-hackers Mon Jul 23 9: 8: 6 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from bingnet2.cc.binghamton.edu (bingnet2.cc.binghamton.edu [128.226.1.18]) by hub.freebsd.org (Postfix) with ESMTP id 23F4B37B405; Mon, 23 Jul 2001 09:08:01 -0700 (PDT) (envelope-from zzhang@cs.binghamton.edu) Received: from opal (cs.binghamton.edu [128.226.123.101]) by bingnet2.cc.binghamton.edu (8.11.4/8.11.4) with ESMTP id f6NG7wk17218; Mon, 23 Jul 2001 12:07:58 -0400 (EDT) Date: Mon, 23 Jul 2001 12:07:47 -0400 (EDT) From: Zhihui Zhang X-Sender: zzhang@opal To: msmith@freebsd.org, "Eugene L. Vorokov" Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: using syscalls in a module (stack problem ?) In-Reply-To: <200107231346.f6NDkh403679@bugz.infotecs.ru> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Just out of curiosity, Linux's kernel stack is one page. Where in the kernel source code that says that we can have two pages instead of one page kernel stack? -Zhihui On Mon, 23 Jul 2001, Eugene L. Vorokov wrote: > > > I call this function with (curproc, PATH_MAX+1), and everything is fine > > > when I have just a few local variables defined in the caller (it all > > > works on MOD_LOAD only). However, if I have 2 buffers, 4096 bytes each, > > > as local variables and then try to allocate userspace memory the same > > > way, kernel crashes - sometimes inside mmap(), sometimes a bit later. > > > > > > Why could this happen ? Is it related to possible stack overflow ? > > > > Yes. The kernel stack is only two pages; you absolutely must not use > > large local variables in the kernel. > > I see. But I still can define them using "static", right ? > > Regards, > Eugene > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message