Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp469226ybm; Wed, 22 May 2019 06:24:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqx0VwnFwgaXPxw/EqnW0P5a/PLoHfEJfhPbpJcPTaK0NCt4DBI2dGjqDNIKRxgsXdo+GycA X-Received: by 2002:a62:e310:: with SMTP id g16mr2234240pfh.36.1558531449693; Wed, 22 May 2019 06:24:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558531449; cv=none; d=google.com; s=arc-20160816; b=VuDO7OpX20hS0IrsM6fgZN7Rb45e4Tjx312gSWgYZuleQPV1Gc/INNGSflfs7s5mTp WDuk3KZ6TaMdKqvZ2A8ouu1Ah15eJsBRwmHXgmdop8+yrUJTIU9hMyyZr6ea8/9Uz1HX +Fn2by9mmKlpcjlsG+t9cLSlsmwMIvfYgdGMS37Djnqq3nYSyI4gq6g74lolq7hITIBE t3ElEYm0dmdWOJAzc72dyVU/DpwIoAXpEmDiFLm13Ud6GqxHW3lJd5Q2HoMBLhWPjz5r OHwiVgTxpgV8+7euxf/4jX4RsIZWrmIGtm2N9kvNQbnPJRj9E/hKaHTLS8ZETfI6QewQ bAWg== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=3wYfsz3NzWq73/PfnYnQlZCY8hnX+ka1xxxJbK4keo4=; b=CDpjOBumAacGwq6y18cgkuorDdRkfYlS+7CTN7xdAX+WL0dT+MVsAupCahbJ1UjuzN sKqo1EeP2+BFQM67Z0Zp0QW1gkxa3HXlv9daZoS7PacAszEMBDL+zxujUrvJHC1zyigL Yvcix9wCwSvVhbCRnP1NVKXYIUqmDWwPPbmIJMomq0Jbp6ET4wIVCroVyQQth0Al56sU 23uEU0KeL1DzPCBSJVDnc8o7Cqmdjg3p2VKaeYal7oRnZxSAG7oDjboMauO8w3yObKo1 OkreupAPAbEgubujeNSjd7j30Sjke4ASfVNF01vL+mMqujygMWD2idlAF9HBNqx4kTEY sbbw== 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 j23si18796369pgn.507.2019.05.22.06.23.52; Wed, 22 May 2019 06:24:09 -0700 (PDT) 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 S1729171AbfEVNWq (ORCPT + 99 others); Wed, 22 May 2019 09:22:46 -0400 Received: from mga12.intel.com ([192.55.52.136]:42170 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728827AbfEVNWq (ORCPT ); Wed, 22 May 2019 09:22:46 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 May 2019 06:22:45 -0700 X-ExtLoop1: 1 Received: from lbrom5-mobl.ger.corp.intel.com (HELO localhost) ([10.249.47.39]) by fmsmga006.fm.intel.com with ESMTP; 22 May 2019 06:22:29 -0700 Date: Wed, 22 May 2019 16:22:27 +0300 From: Jarkko Sakkinen To: Sean Christopherson Cc: Andy Lutomirski , James Morris , "Serge E. Hallyn" , LSM List , Paul Moore , Stephen Smalley , Eric Paris , selinux@vger.kernel.org, Jethro Beekman , "Xing, Cedric" , "Hansen, Dave" , Thomas Gleixner , "Dr. Greg" , Linus Torvalds , LKML , X86 ML , "linux-sgx@vger.kernel.org" , Andrew Morton , "nhorman@redhat.com" , "npmccallum@redhat.com" , "Ayoun, Serge" , "Katz-zamir, Shay" , "Huang, Haitao" , Andy Shevchenko , "Svahn, Kai" , Borislav Petkov , Josh Triplett , "Huang, Kai" , David Rientjes Subject: Re: SGX vs LSM (Re: [PATCH v20 00/28] Intel SGX1 support) Message-ID: <20190522132227.GD31176@linux.intel.com> References: <20190514204527.GC1977@linux.intel.com> <20190515013031.GF1977@linux.intel.com> <20190517000331.GD11204@linux.intel.com> <20190520114105.GD27805@linux.intel.com> <20190521151836.GA4843@linux.intel.com> <20190521155140.GE22089@linux.intel.com> <20190522132022.GC31176@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190522132022.GC31176@linux.intel.com> 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 Wed, May 22, 2019 at 04:20:22PM +0300, Jarkko Sakkinen wrote: > On Tue, May 21, 2019 at 08:51:40AM -0700, Sean Christopherson wrote: > > Except that mmap() is more or less required to guarantee that ELRANGE > > established by ECREATE is available. And we want to disallow mmap() as > > soon as the first EADD is done so that userspace can't remap the enclave's > > VMAs via munmap()->mmap() and gain execute permissions to pages that were > > EADD'd as NX. > > We don't want to guarantee such thing and it is not guaranteed. It does > not fit at all to the multi process work done. Enclaves are detached > from any particular process addresse spaces. It is responsibility of > process to open windows to them. > > That would be completely against work that we've done lately. Example use case: you have a process that just constructs an enclave and sends it to another process or processes for use. The constructor process could have basically anything on that range. This was the key goal of the fd based enclave work. /Jarkko