Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Dec 1999 12:32:03 -0800
From:      Michael Sierchio <kudzu@dnai.com>
To:        Scott Hess <scott@avantgo.com>
Cc:        John Polstra <jdp@polstra.com>, freebsd-core@freebsd.org, freebsd-security@freebsd.org
Subject:   Re: mlockall() not supported (2nd query)
Message-ID:  <3863D843.100453A4@dnai.com>
References:  <XFMail.991224105248.jdp@polstra.com> <102201bf4e40$f23c3a10$1e80000a@avantgo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3863D843.100453A4>