Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753358AbaKGWI6 (ORCPT ); Fri, 7 Nov 2014 17:08:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46201 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753137AbaKGWIz convert rfc822-to-8bit (ORCPT ); Fri, 7 Nov 2014 17:08:55 -0500 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <1791526.rYj1Ea3vWT@sifl> References: <1791526.rYj1Ea3vWT@sifl> <20141105154217.2555.578.stgit@warthog.procyon.org.uk> <20141105154248.2555.15813.stgit@warthog.procyon.org.uk> To: Paul Moore Cc: dhowells@redhat.com, linux-unionfs@vger.kernel.org, selinux@tycho.nsa.gov, linux-fsdevel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/7] SELinux: Stub in copy-up handling MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3176.1415398128.1@warthog.procyon.org.uk> Content-Transfer-Encoding: 8BIT Date: Fri, 07 Nov 2014 22:08:48 +0000 Message-ID: <3177.1415398128@warthog.procyon.org.uk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Paul Moore wrote: > > +static int selinux_inode_copy_up_xattr(struct dentry *src, struct dentry > > ...*dst, > > + const char *name, void *value, size_t *size) > > +{ > > + if (strcmp(name, XATTR_NAME_SELINUX) == 0) > > + return 1; /* Discard */ > > I understand that this is just a stub, but I we need to discuss this at some > point and I figure better in this patch than elsewhere where it might get > lost. > > For the docker, context= mount use case (similar to SELinux/sVirt) dropping > the SELinux xattr is probably an okay behavior. However, I would expect that > ultimately this is something we would want to control by policy and/or the > presence of a context= label. The problem is that the label you actually want has already been set and you have to be careful not to overwrite it. The other hook (->inode_copy_up) is called first to label the destination inode - and that has access to the source file also so it can label the destination with consideration of the attributes on the source. Normally, the attributes on the source will be in memory attached to the source inode, I would imagine. David -- 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/