[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110110232335.GA27029@wavehammer.waldi.eu.org>
Date: Tue, 11 Jan 2011 00:23:35 +0100
From: Bastian Blank <bastian@...di.eu.org>
To: Serge Hallyn <serge.hallyn@...onical.com>
Cc: "Serge E. Hallyn" <serge@...lyn.com>,
containers@...ts.linux-foundation.org,
kernel list <linux-kernel@...r.kernel.org>,
LSM <linux-security-module@...r.kernel.org>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Kees Cook <kees.cook@...onical.com>,
Alexey Dobriyan <adobriyan@...il.com>,
Michael Kerrisk <mtk.manpages@...il.com>
Subject: Re: [PATCH 4/7] allow killing tasks in your own or child userns
On Mon, Jan 10, 2011 at 04:51:51PM -0600, Serge Hallyn wrote:
> Quoting Bastian Blank (bastian@...di.eu.org):
> > Isn't that equal to this?
> >
> > if (ns_capable(tcred->user->user_ns, CAP_KILL))
> > return 1;
> >
> > if (cred->user->user_ns == tcred->user->user_ns &&
> > (cred->euid == tcred->suid ||
> > cred->euid == tcred->uid ||
> > cred->uid == tcred->suid ||
> > cred->uid == tcred->uid))
> > return 1;
> >
> > return 0;
> >
> > I would consider this much easier to read.
>
> Unfortunately, it's actually not equivalent. when capable()
> returns success, then it sets the current->flags |= PF_SUPERPRIV.
> If permission is granted based on userids and the capability
> isn't needed, then we don't want to needlessly set PF_SUPERPRIV.
Well, then switch the two if-clauses.
What is this flag used for anyway? I only see it used in the accounting
stuff, and if every user can get it, it is not longer useful.
Bastian
--
Bones: "The man's DEAD, Jim!"
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists