From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756343AbbCFUIn (ORCPT ); Fri, 6 Mar 2015 15:08:43 -0500 Received: from h2.hallyn.com ([78.46.35.8]:45503 "EHLO h2.hallyn.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754686AbbCFUIk (ORCPT ); Fri, 6 Mar 2015 15:08:40 -0500 Date: Fri, 6 Mar 2015 14:08:38 -0600 From: "Serge E. Hallyn" To: Andy Lutomirski Cc: Christoph Lameter , "Serge E. Hallyn" , Serge Hallyn , Jonathan Corbet , Aaron Jones , LSM List , "linux-kernel@vger.kernel.org" , Andrew Morton , "Andrew G. Morgan" , Mimi Zohar , Austin S Hemmelgarn , Markku Savela , Jarkko Sakkinen , Linux API , Michael Kerrisk Subject: Re: [PATCH] capabilities: Ambient capability set V2 Message-ID: <20150306200838.GA29198@mail.hallyn.com> References: <20150301233359.GA22196@mail.hallyn.com> <20150305171326.GA14998@mail.hallyn.com> <20150306163443.GA28386@mail.hallyn.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 06, 2015 at 11:02:43AM -0800, Andy Lutomirski wrote: > On Fri, Mar 6, 2015 at 10:53 AM, Christoph Lameter wrote: > > On Fri, 6 Mar 2015, Serge E. Hallyn wrote: > > > >> Sorry, something about that patch-patch didn't make sense to me, but I > >> need to look more closely. My objection was that you were able to get the > >> pA capabilities into pP without them being in your pI. Your proposed > >> change didn't seem like it would fix that. > > > > Just tried to fix that. Could it be that cap_inherited is never set even > > for a binary that has > > > > christoph@fujitsu-haswell:~$ getcap ambient_test > > > > ambient_test = cap_setpcap,cap_net_admin,cap_net_raw,cap_sys_nice+eip > > I think that's right. fI doesn't set pI. Right. The idea is that for the running binary to get capability x in its pP, its privileged ancestor must have set x in pI, and the binary itself must be trusted with x in fI. What we are doing is allowing bypassing fI using pA, without bypassing the requirement for x to be in pI. Since pI is intended to be filled (for instance) at login based on username/group, pI generally does not get cleared. At the same time, any software which thinks it is running untrusted code safely without privilege by clearing pI and pP won't be fooled by pA. -serge