Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753664AbbG2QEz (ORCPT ); Wed, 29 Jul 2015 12:04:55 -0400 Received: from h2.hallyn.com ([78.46.35.8]:43142 "EHLO h2.hallyn.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752406AbbG2QEw (ORCPT ); Wed, 29 Jul 2015 12:04:52 -0400 Date: Wed, 29 Jul 2015 11:04:50 -0500 From: "Serge E. Hallyn" To: "Eric W. Biederman" Cc: Andy Lutomirski , "Serge E. Hallyn" , Seth Forshee , Alexander Viro , Serge Hallyn , James Morris , Linux FS Devel , LSM List , SELinux-NSA , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces Message-ID: <20150729160450.GA21625@mail.hallyn.com> References: <1436989569-69582-1-git-send-email-seth.forshee@canonical.com> <1436989569-69582-4-git-send-email-seth.forshee@canonical.com> <20150715214848.GA24204@mail.hallyn.com> <87wpy1camr.fsf@x220.int.ebiederm.org> <87io9kzq5g.fsf@x220.int.ebiederm.org> <87wpy0u1zo.fsf@x220.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87wpy0u1zo.fsf@x220.int.ebiederm.org> 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 Content-Length: 1754 Lines: 35 On Thu, Jul 16, 2015 at 12:04:43AM -0500, Eric W. Biederman wrote: > > I tend to thing that, if we're not honoring the fcaps, we shouldn't be > > honoring the setuid bit either. After all, it's really not a trusted > > file, even though the only user who could have messed with it really > > is the apparent owner. > > For the file caps we can't honor them because you don't have the bits > in struct cred. > > For setuid we can honor it, and setuid is something that the user > namespace allows. Setuid is something explicitly tied to the user id. File capabilities are MAC, that is, explicitly orthogonal to user id. So 100% agreed with honoring setuid in user_ns and, for now, ignoring file caps. As I've mentioned a few times privately, I'm intending to implement user-namespaced file capabilities as a new xattr. Design is not 100% nailed down, but probably it would support a set of userns_fcaps, each of which lists the k_uid of the root user in the namespace assigning the filecaps, followed by three sets. Then when exec()ing the file, if the current->userns->root user has a userns_fcap entry, or there is a -1 entry, then use that, else use nothing. I think this is a very importing thing to support, to remove a barrier to shipping packages with software using filecaps. Without this, any package, say ping, which wants to support being installed in a (unprivileged) cotainer would need to also support use without filecaps, meaning that will likely be the only supported mode. -serge -- 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/