Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp2136534ybx; Fri, 8 Nov 2019 00:07:17 -0800 (PST) X-Google-Smtp-Source: APXvYqwInYDyFoi7lxcBfn1PcsYf1ea0tbL0fMLGGavpAmiFneMKCc7/q8PcRsyZ7243X4bzMwoh X-Received: by 2002:a05:6402:2042:: with SMTP id bc2mr8578713edb.167.1573200436999; Fri, 08 Nov 2019 00:07:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573200436; cv=none; d=google.com; s=arc-20160816; b=XH4MYlxDoWlCKyfgciBTKWTqZOwPVqfQ0AUs4KxGDqhwMs1JYk2LNIDfCefU7TvyU/ 4NB8KJEQs0T7AFGp77TFCsYMHviMXe1CdgTN2K+X1zdjZ9jbHG+BcTU2aNhs/hhA+Zj/ 4m9fA7RhWLJNoi0cXMBTzNLTvtfwnVr9tfuSe0zWivUHokrerBPwqRgnfdEuhFiWGD0D K7rAlHOVrXjL/FPxrFXrvFt0jFOZ2RQqrA+C0j1LAk7jXoCbEYCeoFN9QQStxZv5WJpt hlepikt0AGxEHGt6RYul90ueYal3RGbVGnEBQC89YS0zRzG9i/qnu3mBw6vuXLrIegWF F7mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=baNA86FZdL2p6yupITZCklqVLtqaL1Cp6ahNA85yYFM=; b=fGqaqvoyB39/fJvjncTYyFYvVRtq1OSujbThiNBl0HaqoFUOn8D+jy3KsMrPS37sEO KgvkxCy01J5XKrKIFuXmRZ7ug6ivatyRawaM9IbM16LeiIqIZEZU9ONLTGQjcK54E/yY WkGQuueMyq540krwK64voIhRKFhThg0E+cIOwvcpse++3juz0rqrCiPuKW7vgceLBKCW 0VOQ3ECITrxlF9UAGeRWuBG6Z+rzNkI5Tz16tj8Dvoy6C3gv1eLVS5ABmsbU93Hc1Xl2 E9swCUsAnEDag+vrk4LvR8Pyi/qnDjE6+SjejFr5Iut7ok5AUEAtWXu8ZqDKs2A4BlbH s6fg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u5si325012ejx.286.2019.11.08.00.06.53; Fri, 08 Nov 2019 00:07:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730330AbfKHIFO (ORCPT + 99 others); Fri, 8 Nov 2019 03:05:14 -0500 Received: from mga07.intel.com ([134.134.136.100]:7323 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727421AbfKHIFO (ORCPT ); Fri, 8 Nov 2019 03:05:14 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Nov 2019 00:05:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,280,1569308400"; d="scan'208";a="377700784" Received: from rafalwi-mobl.ger.corp.intel.com (HELO localhost) ([10.252.3.149]) by orsmga005.jf.intel.com with ESMTP; 08 Nov 2019 00:05:02 -0800 Date: Fri, 8 Nov 2019 10:05:01 +0200 From: Jarkko Sakkinen To: Stephen Smalley Cc: Sean Christopherson , linux-kernel@vger.kernel.org, x86@kernel.org, linux-sgx@vger.kernel.org, akpm@linux-foundation.org, dave.hansen@intel.com, nhorman@redhat.com, npmccallum@redhat.com, serge.ayoun@intel.com, shay.katz-zamir@intel.com, haitao.huang@intel.com, andriy.shevchenko@linux.intel.com, tglx@linutronix.de, kai.svahn@intel.com, bp@alien8.de, josh@joshtriplett.org, luto@kernel.org, kai.huang@intel.com, rientjes@google.com, cedric.xing@intel.com, puiterwijk@redhat.com, linux-security-module@vger.kernel.org, Suresh Siddha Subject: Re: [PATCH v23 12/24] x86/sgx: Linux Enclave Driver Message-ID: <20191108080501.GA3370@linux.intel.com> References: <20191028210324.12475-1-jarkko.sakkinen@linux.intel.com> <20191028210324.12475-13-jarkko.sakkinen@linux.intel.com> <173a196e-fa6b-23b8-c818-dfca6cdadcc6@tycho.nsa.gov> <20191031211721.GD10507@linux.intel.com> <4bf866ae-adc8-7902-3714-b62e548d8584@tycho.nsa.gov> <20191101153238.GA2657@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 01, 2019 at 01:16:59PM -0400, Stephen Smalley wrote: > On 11/1/19 11:32 AM, Sean Christopherson wrote: > > On Fri, Nov 01, 2019 at 09:28:17AM -0400, Stephen Smalley wrote: > > > On 11/1/19 9:16 AM, Stephen Smalley wrote: > > > > So, IIUC, that means that merging the driver will create a regression with > > > > respect to LSM control over executable mappings that will only be > > > > rectified at some future point in time if/when someone submits LSM hooks > > > > or calls to existing hooks to restore such control.? That doesn't seem > > > > like a good idea.? Why can't you include at least that basic level of > > > > control now?? It is one thing to defer finer grained control or > > > > SGX-specific access controls to the future - that I can understand.? But > > > > introducing a regression in the existing controls is not really ok. > > > > > > Unless you are arguing that the existing checks on mmap/mprotect of > > > /dev/sgx/enclave are a coarse-grained approximation (effectively requiring > > > WX to the file or execmem for any user of SGX). > > > > Yes, that's the argument as running any enclave will require RWX access to > > /dev/sgx/enclave. EXECMEM won't trigger for SGX users as /dev/sgx/enclave > > must be MAP_SHARED and it's a non-private file (not backed by anonymous > > inode, in case I got the file terminology wrong). > > Ok, so for SELinux's purposes, one will need to allow :file { open ioctl map > read write execute } to whatever type is ultimately assigned to > /dev/sgx/enclave in order to use SGX. AFAIK yes. /Jarkko