From owner-freebsd-security Fri Dec 24 12:37:11 1999 Delivered-To: freebsd-security@freebsd.org Received: from oberon.dnai.com (oberon.dnai.com [207.181.194.97]) by hub.freebsd.org (Postfix) with ESMTP id E1C2C14CDE; Fri, 24 Dec 1999 12:37:07 -0800 (PST) (envelope-from kudzu@dnai.com) Received: from dnai.com (dnai-216-15-121-66.cust.dnai.com [216.15.121.66]) by oberon.dnai.com (8.9.3/8.9.3) with ESMTP id MAA02185; Fri, 24 Dec 1999 12:36:34 -0800 (PST) Message-ID: <3863D843.100453A4@dnai.com> Date: Fri, 24 Dec 1999 12:32:03 -0800 From: Michael Sierchio X-Mailer: Mozilla 4.7 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Scott Hess Cc: John Polstra , freebsd-core@freebsd.org, freebsd-security@freebsd.org Subject: Re: mlockall() not supported (2nd query) References: <102201bf4e40$f23c3a10$1e80000a@avantgo.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-security@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Scott Hess wrote: > Does anything bad happen if you mlock() essentially everything? Something > like mlock( NULL, (unsigned)-1), but perhaps more targetted than that. > That would appear to lock all of the VM pages you already are using, but > perhaps not the VM pages you haven't allocated as of yet? It's unclear to me how to lock the stack, for example -- since it grows downward, a call to mlock() would require guessing (or finding) the current allocated size. And, as you note, this doesn't protect any future pages -- more of a problem for the stack than anything. I can easily write a wrapper for malloc/free to handle locking individual chunks -- but I'm unclear on the business of doing the equivalent of a 'mlockall(MCL_CURRENT | MCL_FUTURE)' I would be happy to submit a patch, but I might need some guidance. Cheers, Michael -- QUI ME AMET, CANEM MEUM ETIAM AMET To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-security" in the body of the message