From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755417AbbFRPOG (ORCPT ); Thu, 18 Jun 2015 11:14:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45983 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751955AbbFRPN5 (ORCPT ); Thu, 18 Jun 2015 11:13:57 -0400 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: <5582DC0F.7090800@tycho.nsa.gov> References: <5582DC0F.7090800@tycho.nsa.gov> <20150618133215.12722.70352.stgit@warthog.procyon.org.uk> <20150618133310.12722.16624.stgit@warthog.procyon.org.uk> To: Stephen Smalley Cc: dhowells@redhat.com, viro@zeniv.linux.org.uk, miklos@szeredi.hu, linux-fsdevel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-unionfs@vger.kernel.org, linux-kernel@vger.kernel.org, SELinux , Paul Moore Subject: Re: [PATCH 7/8] SELinux: Create a common helper to determine an inode label MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <17512.1434640431.1@warthog.procyon.org.uk> Date: Thu, 18 Jun 2015 16:13:51 +0100 Message-ID: <17513.1434640431@warthog.procyon.org.uk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Stephen Smalley wrote: > > + if ((sbsec->flags & SE_SBINITIALIZED) && > > + (sbsec->behavior == SECURITY_FS_USE_MNTPOINT)) { > > + *_new_isid = sbsec->mntpoint_sid; > > + } else if (tsec->create_sid) { > > This doesn't quite match the logic in inode_init_security today, see its > checking of SBLABEL_MNT. Fair point. What does SBLABEL_MNT mean precisely? It seems to indicate one of an odd mix of behaviours. I presume it means that we *have* to calculate a label and can't get one from the underlying fs if it is not set. Also, in: sbsec->flags |= SE_SBINITIALIZED; if (selinux_is_sblabel_mnt(sb)) sbsec->flags |= SBLABEL_MNT; should SE_SBINITIALIZED be set after SBLABEL_MNT? And should there be a memory barrier in here somewhere before the setting of SE_SBINITIALIZED? David From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Howells In-Reply-To: <5582DC0F.7090800@tycho.nsa.gov> References: <5582DC0F.7090800@tycho.nsa.gov> <20150618133215.12722.70352.stgit@warthog.procyon.org.uk> <20150618133310.12722.16624.stgit@warthog.procyon.org.uk> To: Stephen Smalley Subject: Re: [PATCH 7/8] SELinux: Create a common helper to determine an inode label MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Thu, 18 Jun 2015 16:13:51 +0100 Message-ID: <17513.1434640431@warthog.procyon.org.uk> Cc: miklos@szeredi.hu, linux-unionfs@vger.kernel.org, linux-kernel@vger.kernel.org, dhowells@redhat.com, linux-security-module@vger.kernel.org, viro@zeniv.linux.org.uk, SELinux , linux-fsdevel@vger.kernel.org List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: Stephen Smalley wrote: > > + if ((sbsec->flags & SE_SBINITIALIZED) && > > + (sbsec->behavior == SECURITY_FS_USE_MNTPOINT)) { > > + *_new_isid = sbsec->mntpoint_sid; > > + } else if (tsec->create_sid) { > > This doesn't quite match the logic in inode_init_security today, see its > checking of SBLABEL_MNT. Fair point. What does SBLABEL_MNT mean precisely? It seems to indicate one of an odd mix of behaviours. I presume it means that we *have* to calculate a label and can't get one from the underlying fs if it is not set. Also, in: sbsec->flags |= SE_SBINITIALIZED; if (selinux_is_sblabel_mnt(sb)) sbsec->flags |= SBLABEL_MNT; should SE_SBINITIALIZED be set after SBLABEL_MNT? And should there be a memory barrier in here somewhere before the setting of SE_SBINITIALIZED? David