Re: mlock as non-root: use rlimits

From: Arjan van de Ven
Date: Sat Jun 05 2004 - 02:00:59 EST


On Fri, Jun 04, 2004 at 11:18:04AM -0700, Chris Wright wrote:
> The hugetlbfs and SHM_LOCK bits don't work well with rlimits. For
> example, it's trivial to corrupt the locked_vm count with a SHM_LOCK
> segment. I like this, but I think it only works with mlock(). Did I
> miss something?

Hmm I really wanted this rlimit to move to the struct user, but afaik that
work hasn't been merged yet. Once that is done it's easy to fix the SHM
stuff, just keep track of the struct user to which it's accounted. But you
are right, the count can go bonkers if another process unlocks is than that
locked it.

Attachment: pgp00000.pgp
Description: PGP signature