Re: [patch] mlock-as-nonroot revisted

From: Andrea Arcangeli
Date: Tue Aug 03 2004 - 16:24:21 EST


On Tue, Aug 03, 2004 at 05:13:56PM -0400, Rik van Riel wrote:
> On Tue, 3 Aug 2004, Andrea Arcangeli wrote:
>
> > > - if (shmflg & SHM_HUGETLB)
> > > + if (shmflg & SHM_HUGETLB) {
> > > + /* hugetlb_zero_setup takes care of mlock user accounting */
> > > file = hugetlb_zero_setup(size);
> > > + shp->mlock_user = current->user;
> > > + } else {
>
> > where do you change mlock_user in chown?
>
> You don't. Normal users aren't allowed to chown each
> other's files, nor are they allowed to "give away" one
> of their files to somebody else.
>
> On unlock the quota gets deducted from the user who
> created the hugetlbfs file.
>
> This means there shouldn't be security issues with this
> approach. Let me know if I've overlooked one.

I agree there aren't security issues, but it's still very wrong to
charge the old user if the admin gives the locked ram to a new user.
This erratic behaviour shows how much the rlimit approch is flawed for
named fs objects that have nothing to do with the transient task that
created them.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/