Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1294264ybi; Thu, 30 May 2019 15:05:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqwLMbwc4255cUMKRpjAzX7J/ZYplspPpD1xYtd+d1HwSU5BbWuSmQWjgU43MaXnKQIc+8yB X-Received: by 2002:a63:6848:: with SMTP id d69mr5806886pgc.0.1559253949978; Thu, 30 May 2019 15:05:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559253949; cv=none; d=google.com; s=arc-20160816; b=rV9WCHHf6TIPGUePzZOJTyZwfjnB7n0wnAoErd9wd1elqytiiLdKtHLmrPly6/utpo k67tZAnLGitQG2ja23CBuivF79A74cX7nReJkNbI8+dGkYLYP/s2Ml47CNQDLqB9Igno o1Mqld3EvxIxY4sCoqReIcv3Nq9xIHzDFZa6UhIqCIp9038hw+epyLFHt0vKirdwNnhZ 80cM79mT4dVYwTHEHHKFLtf+afY2ssmRC/koaMthSKTeHj5fqmuJakc+DE5WNYPkW1Qp pENDUIs8kF05I1g7NLbEQO6c5dV1FZfR9SxNEj+XT1gFmpDURj2F6ZQN9pfksXnUsLOn BNvA== 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=SU1nGHHdQ2fepz9H6UI3XwxqUOGTQjcsbP5zTfz6ces=; b=HANhuR08EtQai9bZxTCicX/qJmRm/wY8OxJ5oXEiu+q4ldizNdCmCKQv/nSg3cNWL9 NIpGNbGwQlB8Mz9DIapv74Cs9tRuSY/2QA3RPiS72swiSFH6YV8TVRQ4K0zocAMw0mVx k58Q7JGO5WRf7N4T5p3mIIRqcEuGxuaZo4PWSh1KFgv3HXEh0QGRoB5udjCf9BdYLxqp HNaUZSuU8xc7HUHAEFwXqOlOpcBawRIYU4ZWlozrktkSwcQ3g0LyX4S04KytGpab5xJu voNiShlyGMl7v28P0+JTmQWnYvDN2yS+yIf+r2LLgyJX4n3QvYYNRBtORTFTr2hAtDv4 716Q== 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 t188si3977385pgc.228.2019.05.30.15.05.34; Thu, 30 May 2019 15:05:49 -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 S1727013AbfE3WDg (ORCPT + 99 others); Thu, 30 May 2019 18:03:36 -0400 Received: from mga04.intel.com ([192.55.52.120]:42231 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726308AbfE3WDf (ORCPT ); Thu, 30 May 2019 18:03:35 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 May 2019 14:36:02 -0700 X-ExtLoop1: 1 Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.36]) by fmsmga008.fm.intel.com with ESMTP; 30 May 2019 14:36:01 -0700 Date: Thu, 30 May 2019 14:36:01 -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: <20190530213601.GC27551@linux.intel.com> References: <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> <20190530211645.GB27551@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 02:23:07PM -0700, Andy Lutomirski wrote: > On Thu, May 30, 2019 at 2:16 PM Sean Christopherson > wrote: > > > > 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). > > > > If ->vm_file is NULL, then I think some privilege is needed. I > suppose the policy could have a new lesser permission EXECUNTRUSTED > which is like EXECMOD but you can't modify it. I'm not convinced this > is particular important. Assuming MRENCLAVE generated by Graphene or any other hosting scheme are stable[1], then avoiding EXEC means the user can effectively whitelist what enclaves are runnable by Graphene, even if the kernel doesn't implement security_enclave_create/init(). I agree that it probably isn't all that important, it's more of a "why not" argument, i.e. what is gained by not using sigstruct as a proxy? [1] What in the world is being attested if MRENCLAVE isn't stable?