Re: disable-cap-mlock

Andrea Arcangeli
2004-04-02T01:38:02Z

On Thu, Apr 01, 2004 at 05:30:14PM -0800, Chris Wright wrote:
> * Andrea Arcangeli (andrea@suse.de) wrote:
> > please elaborate how can you account for shmget(SHM_HUGETLB) with the
> > rlimit. The rlimit is just about the _address_space_ mlocked, there's no
> > way to account for something _outside_ the address space with the rlimit,
> > period. If you attempt doing that, _that_ will be THE true hack(tm) ;).
>
> Heh ;-) OK, here's the patch. When you setup the vmas for the huge pages
> account for them, when you tear them down, account for that as well.
> It's very possible that I've missed the obvious, but it at least pasts

what you missed is that after you locked_vm -= you don't free anything,
you only unmap them from the address space which means nothing in terms
of amount if pinned ram.

so patch is broken and insecure as far as I can tell.