public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: "Serge E. Hallyn" <serue@us.ibm.com>
Cc: lkml <linux-kernel@vger.kernel.org>,
	David Howells <dhowells@redhat.com>,
	Michael Kerrisk <mtk.manpages@gmail.com>,
	Dhaval Giani <dhaval@linux.vnet.ibm.com>,
	James Morris <jmorris@namei.org>
Subject: Re: [PATCH 2/2] user namespaces: require cap_set{ug}id for CLONE_NEWUSER
Date: Fri, 05 Dec 2008 09:14:05 -0800	[thread overview]
Message-ID: <m1r64mpmsi.fsf@frodo.ebiederm.org> (raw)
In-Reply-To: <20081203191733.GA16652@us.ibm.com> (Serge E. Hallyn's message of "Wed, 3 Dec 2008 13:17:33 -0600")

"Serge E. Hallyn" <serue@us.ibm.com> writes:

> While ideally CLONE_NEWUSER will eventually require no
> privilege, the required permission checks are currently
> not there.  As a result, CLONE_NEWUSER has the same effect
> as a setuid(0)+setgroups(1,"0").  While we already require
> CAP_SYS_ADMIN, requiring CAP_SETUID and CAP_SETGID seems
> appropriate.

Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>

The patch looks good, and we are likely to need more caps to
actually use it.
 
>
> Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
> ---
>  kernel/fork.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/kernel/fork.c b/kernel/fork.c
> index 1dd8945..e3a85b3 100644
> --- a/kernel/fork.c
> +++ b/kernel/fork.c
> @@ -1344,7 +1344,8 @@ long do_fork(unsigned long clone_flags,
>  		/* hopefully this check will go away when userns support is
>  		 * complete
>  		 */
> -		if (!capable(CAP_SYS_ADMIN))
> +		if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SETUID) ||
> +				!capable(CAP_SETGID))
>  			return -EPERM;
>  	}
>  
> -- 
> 1.5.4.3

  parent reply	other threads:[~2008-12-05 17:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-03 19:17 [PATCH 1/2] user namespaces: let user_ns be cloned with fairsched Serge E. Hallyn
2008-12-03 19:17 ` [PATCH 2/2] user namespaces: require cap_set{ug}id for CLONE_NEWUSER Serge E. Hallyn
2008-12-05 16:24   ` Eric W. Biederman
2008-12-05 16:45     ` Serge E. Hallyn
2008-12-05 17:17       ` Eric W. Biederman
2008-12-05 17:14   ` Eric W. Biederman [this message]
2008-12-07 22:47     ` James Morris
2008-12-05 10:07 ` [PATCH 1/2] user namespaces: let user_ns be cloned with fairsched James Morris
2008-12-05 14:44   ` Serge E. Hallyn
2008-12-07 22:46 ` James Morris
2008-12-08 16:04   ` Serge E. Hallyn
2008-12-08 21:15     ` James Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1r64mpmsi.fsf@frodo.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=dhaval@linux.vnet.ibm.com \
    --cc=dhowells@redhat.com \
    --cc=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=serue@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox