lkml.org 
[lkml]   [2004]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] mlock-as-nonroot revisted
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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:04    [W:0.090 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site