From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Serge E. Hallyn" Subject: Re: [REVIEW][PATCH 2/5] userns: Allow PR_CAPBSET_DROP in a user namespace. Date: Fri, 30 Aug 2013 01:15:14 +0000 Message-ID: <20130830011513.GC12720@mail.hallyn.com> References: <87ob8gys0d.fsf@xmission.com> <87eh9cyrxj.fsf@xmission.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <87eh9cyrxj.fsf-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: "Eric W. Biederman" Cc: Richard Weinberger , Linux Containers , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: containers.vger.kernel.org Quoting Eric W. Biederman (ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org): > > As the capabilites and capability bounding set are per user namespace > properties it is safe to allow changing them with just CAP_SETPCAP > permission in the user namespace. > > Signed-off-by: "Eric W. Biederman" > Tested-by: Richard Weinberger Acked-by: Serge Hallyn > --- > security/commoncap.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/security/commoncap.c b/security/commoncap.c > index c44b6fe..9fccf71 100644 > --- a/security/commoncap.c > +++ b/security/commoncap.c > @@ -824,7 +824,7 @@ int cap_task_setnice(struct task_struct *p, int nice) > */ > static long cap_prctl_drop(struct cred *new, unsigned long cap) > { > - if (!capable(CAP_SETPCAP)) > + if (!ns_capable(current_user_ns(), CAP_SETPCAP)) > return -EPERM; > if (!cap_valid(cap)) > return -EINVAL; > -- > 1.7.5.4