Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2126118yba; Fri, 17 May 2019 10:53:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNv8+J5LG0s4McIWflvDY0udzf0pLIdMcv0+0o7+vxNx3M3IDQlcfc2GCxOUfQvQeyeK3o X-Received: by 2002:a63:5014:: with SMTP id e20mr57987516pgb.2.1558115630934; Fri, 17 May 2019 10:53:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558115630; cv=none; d=google.com; s=arc-20160816; b=n9ddh+jIysLihUTD4TjVZV5lKx14sqnDGRuKQOhg18wACxbfY3JRIEDYIJUrCapqJG 4+YoYutSReUcngb8xQTOWO9cY4yVq3erIFTL8KZh6mvrvzQ+j7nbF+4FvkclKsHKT3yk 0a2Y1FwOlRaMfy8khdNW0IHZiprTEHNrDiT6C0a4aBvl3NjdVLW470GQ20MpIOyipIFo mM3iPWk+pYFiHPWcN+jNoCKYMijR7aP8Jp5j1qlXwjTqZ0Cv/a0YdOkFq9M2Zhb3tDIp QC2QbCzPvFWme+pLYD0Nj1SPiEJymGCFUGWArQBPyiwJc2CyMM/9flTanyskHdeSfjRf pH7w== 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=eBmZukVamywuGEzV5L5BGgJ4nq+O3XZCH57XgNyMwJI=; b=KAo/15/NnxVyDkPqbwMtLPLw7g/v+Zgwk/wSHJHefY7c9ajwtX9+gVSBorqYnMFEzz l6x+DKB8mE4lJR5pyUcu3FfWeGJUusS3BzDKcweJ63NPMBplpgH6VjakHwHG+0zBD2ir 7jl9Y5u25scwLob/vY+wOzHEyy8347nBIshaf5u96JA7VXRCquaMH+aOSH3aO7q+Gm0I g81HvrvC9y1Bcd9UG9tmPcFgxCLgg6budkK5gD+/4/w7DavkDJgpG8oeTcD/wipt+l5h oAPZ2I+2NM6wBT3Ft5S01FytISOwfO9ZgUjRuUT2GF3Kn38JfRcbDeB8r3GW6zYoz8CY 9EwQ== 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 b8si8827107plb.351.2019.05.17.10.53.35; Fri, 17 May 2019 10:53:50 -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 S1729000AbfEQRui (ORCPT + 99 others); Fri, 17 May 2019 13:50:38 -0400 Received: from mga05.intel.com ([192.55.52.43]:45330 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727183AbfEQRui (ORCPT ); Fri, 17 May 2019 13:50:38 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 May 2019 10:50:37 -0700 X-ExtLoop1: 1 Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.36]) by orsmga002.jf.intel.com with ESMTP; 17 May 2019 10:50:36 -0700 Date: Fri, 17 May 2019 10:50:36 -0700 From: Sean Christopherson To: Stephen Smalley Cc: "Xing, Cedric" , Andy Lutomirski , James Morris , "Serge E. Hallyn" , LSM List , Paul Moore , Eric Paris , "selinux@vger.kernel.org" , Jarkko Sakkinen , 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: <20190517175036.GD15006@linux.intel.com> References: <960B34DE67B9E140824F1DCDEC400C0F654E38CD@ORSMSX116.amr.corp.intel.com> <960B34DE67B9E140824F1DCDEC400C0F654E3FB9@ORSMSX116.amr.corp.intel.com> <6a97c099-2f42-672e-a258-95bc09152363@tycho.nsa.gov> <20190517150948.GA15632@linux.intel.com> <80013cca-f1c2-f4d5-7558-8f4e752ada76@tycho.nsa.gov> <20190517172953.GC15006@linux.intel.com> <7de94229-f223-64bd-de11-7a601ec26938@tycho.nsa.gov> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7de94229-f223-64bd-de11-7a601ec26938@tycho.nsa.gov> 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 Fri, May 17, 2019 at 01:42:50PM -0400, Stephen Smalley wrote: > On 5/17/19 1:29 PM, Sean Christopherson wrote: > >AIUI, having FILE__WRITE and FILE__EXECUTE on /dev/sgx/enclave would allow > >*any* enclave/process to map EPC as RWX. Moving to anon inodes and thus > >PROCESS__EXECMEM achieves per-process granularity. > > > > No, FILE__WRITE and FILE__EXECUTE are a check between a process and a file, > so you can ensure that only whitelisted processes are allowed both to > /dev/sgx/enclave. Ah, so each process has its own FILE__* permissions for a specific set of files? Does that allow differentiating between a process making an EPC page RWX and a process making two separate EPC pages RW and RX?