Re: [patch] mlock-as-nonroot revisted

From: Rik van Riel
Date: Tue Aug 03 2004 - 16:15:34 EST


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.

--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan

-
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/