Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp467120ybm; Wed, 22 May 2019 06:22:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqzVu7yC73Hqe25NOLXS1k0YY0A9PcXGtgQfbeFoEBYogaeb3sO5GuQMNjM/Y0lPB9hdxsHz X-Received: by 2002:a63:f922:: with SMTP id h34mr4707350pgi.230.1558531329891; Wed, 22 May 2019 06:22:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558531329; cv=none; d=google.com; s=arc-20160816; b=z1lcz17qAMYERczWUP/PopXKht1Ys2EEKn3IRcvXVPvWtCFeo+OucfaJ4u9O4+0WhK GD8gMc/CesPiRDtLmhWqLLfbrwVPZ3QH/HlnmkdhV0L6fQDjF1GKYmAmR02WKLrNH4/5 PVNf3bF40BcuQZa1iPu5WM2/GKTJIHFSHjthhTIoe/kVbhuI7XLwdyQAqurkCjGzFoar SpoU703ZjYippVwBGUlh+p6hHxGrcM41K4T3xEUCP3oSlIFQRbxAXDcKC/epNuyE3Upq ukfB7FrmBAste1kEZEuXq+GNMZ7/kXCkWaDSgrhsMubNDyZSgzHYDVPvcOBc583b4sUy xu4Q== 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=H3MQnke3nCuOGmDd/dcY5P8ObhUPuf+7+HcAD5OcgVY=; b=F9hg+DoF2AHbwoKBeT+DdPAQJfIU3y1fhMCR9+N3y8QqBqPEkwxcN6Z7UxPRWmHfkl 9bYP49aSEiwyayGopm8+OK0fWFUHXWukIVtghOQiknVvdSKSZdqpruRShIGiIWEgHLHT n3LpEWgVm79B9aE9UtkmZ6CcKaI0sTCilPzIQbTcu6ISRouhDSbk5GbbxRTMm0r6/aZo JDfM/MxKtubauqWZ4iQBeGxNbovL3A3a3tgbmxYm7VAoVyPt5y34dm3lrkFYxABsxqRv z7xHMCIFFCAftnol+xaY1VRyAmQhx3JIBbQl07ZAVxzATz3TpBiuyU4l9OMNpJ66EE7U k9RQ== 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 r7si25800567ple.418.2019.05.22.06.21.54; Wed, 22 May 2019 06:22: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 S1729417AbfEVNUf (ORCPT + 99 others); Wed, 22 May 2019 09:20:35 -0400 Received: from mga18.intel.com ([134.134.136.126]:53383 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728447AbfEVNUf (ORCPT ); Wed, 22 May 2019 09:20:35 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 May 2019 06:20:34 -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:20:24 -0700 Date: Wed, 22 May 2019 16:20:22 +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: <20190522132022.GC31176@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190521155140.GE22089@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 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. > Actually, conceptually it's probably more intuitive to disallow mmap() at > ECREATE, i.e. the act of creating an enclave pins the associated virtual > address range until the enclave is destroyed. /Jarkko