From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756153AbbIYMtj (ORCPT ); Fri, 25 Sep 2015 08:49:39 -0400 Received: from mail-io0-f180.google.com ([209.85.223.180]:36165 "EHLO mail-io0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755833AbbIYMth (ORCPT ); Fri, 25 Sep 2015 08:49:37 -0400 Date: Fri, 25 Sep 2015 07:49:24 -0500 From: Seth Forshee To: "Eric W. Biederman" Cc: Alexander Viro , Serge Hallyn , James Morris , "Serge E. Hallyn" , Andy Lutomirski , linux-fsdevel@vger.kernel.org, linux-security-module@vger.kernel.org, selinux@tycho.nsa.gov, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org Subject: Re: [PATCH v4 4/7] fs: Limit file caps to the user namespace of the super block Message-ID: <20150925124924.GB104990@ubuntu-hedt> References: <1443039368-55445-1-git-send-email-seth.forshee@canonical.com> <1443039368-55445-5-git-send-email-seth.forshee@canonical.com> <87fv23o4vs.fsf@x220.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87fv23o4vs.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 On Thu, Sep 24, 2015 at 04:59:35PM -0500, Eric W. Biederman wrote: > Seth Forshee writes: > > > Capability sets attached to files must be ignored except in the > > user namespaces where the mounter is privileged, i.e. s_user_ns > > and its descendants. Otherwise a vector exists for gaining > > privileges in namespaces where a user is not already privileged. > > > > Add a new helper function, in_user_ns(), to test whether a user > > namespace is the same as or a descendant of another namespace. > > Use this helper to determine whether a file's capability set > > should be applied to the caps constructed during exec. > > No issues with this but given that we always pass current_user_ns() > we may want to simplify the users of in_user_ns by renaming it > current_in_user_ns() and hard codeing current_user_ns(). Sure, if that's what you prefer then I'll change it. Seth