Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1255780ybi; Thu, 30 May 2019 14:19:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqx4hOzGyixUQU+mh3f145BLOWAL02pr2kGbzVavx6ltvw1+Vc3lc5jJHPi4Z8KNEvVkKgT7 X-Received: by 2002:a17:902:4383:: with SMTP id j3mr5728985pld.320.1559251160212; Thu, 30 May 2019 14:19:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559251160; cv=none; d=google.com; s=arc-20160816; b=oaDL0Q5KTqujzQFuOsRJ5q/cORpjy9agaKFPKINSe997rxQM8wSNqhk6WeClM+OHKx Mg5Jvipm5BQKEiAdysUhadU3ykxZKRDeSG8ciJvKKBeYVS8dVN55oAvjR1QGg8dRRSAx KxPNhkR8h/x/mPPscuySixR7IsOB5jiAnVJiWvAq5M8zHarAVKeRiqMhMjyhC6iuSvGR ElDwTwGhagY3qxk268PDR2sqP5P+HCy3DylRGbuSewyXOdM2KgLOiXYLF8cGZZQ3DTuK 3ORAS0OwBwCWom8n6x24lbh6pXIo/fTHs1vcRj5LAXjza8Rh5C9eERsQGi7boehlMjVa LYZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=QH0m44cId7K8bFVvg2Wpv4KLCJmqaZgmLIjj1w00BOI=; b=nh8r60J/XtuuI6R5NG1w+RqrxsH2uKqIBajOGHUdRjxOPCECFyOs9W2P/iCMUnamZY lviMVMfCP8XzzZIr+Q6J603N+Vl0OKD4PC0u9UNczZc82k8cGN0KL+9Y3rLk7yw0NRaN oysHWb7EsPp5L1jtVH+ebeGW71C2gODU8lVDxlFEKbNM2vCLHUQSayMdGcmRzoKJk9GJ dtFk5GA/+Gr7LtoOcX4I0PgLZSfdj/T+m5l0HJt6VHQQCxX+Qx0UTW1Mm6WDTTm2hTxb 46AuOUSrHcnResd3Dclgs9Zc/+O7DKlVcPI/YRmn7TM9PYktX57whNSBYwnb+UPzgb+l UqUg== 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 c1si3518573pjs.86.2019.05.30.14.19.04; Thu, 30 May 2019 14:19:20 -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 S1726794AbfE3VQs (ORCPT + 99 others); Thu, 30 May 2019 17:16:48 -0400 Received: from mga06.intel.com ([134.134.136.31]:47617 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726308AbfE3VQr (ORCPT ); Thu, 30 May 2019 17:16:47 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 May 2019 14:16:46 -0700 X-ExtLoop1: 1 Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.36]) by fmsmga006.fm.intel.com with ESMTP; 30 May 2019 14:16:45 -0700 Date: Thu, 30 May 2019 14:16:45 -0700 From: Sean Christopherson To: Andy Lutomirski Cc: Stephen Smalley , "Xing, Cedric" , William Roberts , Jarkko Sakkinen , James Morris , "Serge E. Hallyn" , LSM List , Paul Moore , Eric Paris , "selinux@vger.kernel.org" , Jethro Beekman , "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: <20190530211645.GB27551@linux.intel.com> References: <960B34DE67B9E140824F1DCDEC400C0F654E9824@ORSMSX116.amr.corp.intel.com> <20190528202407.GB13158@linux.intel.com> <285f279f-b500-27f0-ab42-fb1dbcc5ab18@tycho.nsa.gov> <960B34DE67B9E140824F1DCDEC400C0F654EB487@ORSMSX116.amr.corp.intel.com> <678a37af-797d-7bd5-a406-32548a270e3d@tycho.nsa.gov> <20190530180110.GB23930@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 30, 2019 at 12:20:45PM -0700, Andy Lutomirski wrote: > On Thu, May 30, 2019 at 11:01 AM Sean Christopherson > wrote: > > > > On Thu, May 30, 2019 at 09:14:10AM -0700, Andy Lutomirski wrote: > > > Enclave file -- that is, the file backing the vma from which the data is loaded. > > > > It wasn't explicitly called out in Andy's proposal(s), but the idea is > > that the SGX driver would effectively inherit permissions from the source > > VMA (EADD needs a source for the initial value of the encave page). > > I actually meant for it to *not* work like this. I don't want the > source VMA to have to be VM_EXEC. I think the LSM should just check > permissions on ->vm_file. But if ->vm_file is NULL, i.e. the enclave is not backed by a file, then PROCESS__EXECMEM is required (or more likely, ENCLAVE__EXECMEM). In practice, it's the same net effect of using sigstruct as a proxy, i.e. *something* has to get to the file system to avoid EXECMEM. But putting the entire enclave to the filesystem seems like a heaver lift than dumping the sigstruct. And if sigstruct needs to be in the file system for security_enclave_create/init()...