Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4785598yba; Mon, 20 May 2019 03:50:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqzq7eqHCaCXozfYUZ7Vx+qIfaV2wRYzy8eLu63GRv3MOuPulqObLQQcTEz/shcUCFvMVkuq X-Received: by 2002:aa7:8083:: with SMTP id v3mr15436863pff.135.1558349424316; Mon, 20 May 2019 03:50:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558349424; cv=none; d=google.com; s=arc-20160816; b=hDn39Zcl7Zly3YDbrkK71eNlN6dvPhApDts2Nc48roHKuYCgFb8cTcC9gmN5iLefSl wFAwb2G3djI/xhfA54X8qMVpwroQdAgB2W9iQNnn5Qr3PYd7sHUotjfaEtlF3LUxBJaV f7THW1/j++IujHC4bgPk2xLrpJBrzrxWmSCWTQxG5tgPaKyCd1A9qBXz96YRVtsJM2qn 0XXKxFUF7dLnHB2+LK4AXN41+TqvlbooGQFsolXmw3JtNjp2k7sVU5WoJ/VwLdCFlRvU GM8JK1iACEbL7NNLqrTX3ogX80sXGvcktqiD+02AVhEGTrAqGO+cpMGOviiGaFnPjKF6 uALA== 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:reply-to:message-id :subject:cc:to:from:date; bh=ljvScx35iqpCksF8Rz7F17VXEQfuhKonPyI0h3qXVdA=; b=WzvLo33HnBCbAqxJBF5//1rsVSLazCRkH0u8OEDuwx96irhDiKmruPxqBJ4M8u0Rk0 D8pLXw4NA8q1Rhu9zYuB9TYmKRI1fzJk60c1dSqIxhyXatLzXR0xb3w2ly7dO+ExFsqe m4NSEqM3XnBZ28LogI6f/YCa1av942NXDjmtsLncSsxuSUENzB2K1KSA9jTYl9YRjtoZ LK21BNCgTAIROESvFf2d+NY7bEXHhm4ecKFW4WLcV0mpZ5U/+zkQ187xW6bp/mQr9SOE i6V1YG27hRb4VtH+pDGIPqI2SfhFV8xBstn3SttCwKdtiYj5Dz7Og29FUC1Q5F/4qJMB FWvg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 5si17635730plx.19.2019.05.20.03.50.10; Mon, 20 May 2019 03:50:24 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732226AbfETJlv (ORCPT + 99 others); Mon, 20 May 2019 05:41:51 -0400 Received: from wind.enjellic.com ([76.10.64.91]:32972 "EHLO wind.enjellic.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726126AbfETJlu (ORCPT ); Mon, 20 May 2019 05:41:50 -0400 Received: from wind.enjellic.com (localhost [127.0.0.1]) by wind.enjellic.com (8.15.2/8.15.2) with ESMTP id x4K9cIa4007978; Mon, 20 May 2019 04:38:18 -0500 Received: (from greg@localhost) by wind.enjellic.com (8.15.2/8.15.2/Submit) id x4K9cFlE007977; Mon, 20 May 2019 04:38:15 -0500 Date: Mon, 20 May 2019 04:38:15 -0500 From: "Dr. Greg" To: James Morris Cc: Andy Lutomirski , Sean Christopherson , "Serge E. Hallyn" , LSM List , Paul Moore , Stephen Smalley , Eric Paris , selinux@vger.kernel.org, Jarkko Sakkinen , 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: <20190520093815.GA7187@wind.enjellic.com> Reply-To: "Dr. Greg" References: <20190514204527.GC1977@linux.intel.com> <20190515013031.GF1977@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.3 (wind.enjellic.com [127.0.0.1]); Mon, 20 May 2019 04:38:18 -0500 (CDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 16, 2019 at 05:24:33PM +1000, James Morris wrote: Good morning, I hope everyone had a pleasant weekend. James, I believe the last time our paths crossed was at the Linux Security Summit in Seattle, I trust you have been well since then. > On Wed, 15 May 2019, Andy Lutomirski wrote: > > > On Wed, May 15, 2019 at 3:46 PM James Morris wrote: > > > > > > You could try user.sigstruct, which does not require any privs. > > > > > > > I don't think I understand your proposal. What file would this > > attribute be on? What would consume it? > It would be on the enclave file, so you keep the sigstruct bound to > it, rather than needing a separate file to manage. It would > simplify any LSM policy check. > > It would be consumed by (I guess) the SGX_INIT_THE_ENCLAVE ioctl in your > example, instead of having a 2nd fd. I've watched this discussion regarding LSM, sigstructs and file descriptors with some fascination, since all of this infrastructure already exists and should be well understood by anyone who has been active in SGX runtime development. There would thus seem to be a disconnect between SGX driver developers and the consumers of the services of the driver. The existing enclave format, codified by the silo within Intel that is responsible for the existing SDK/PSW, implements a notes section stored inside a standard ELF shared library image. The notes section contains a significant amount of metadata that is used to direct the instantiation of what will be the initialized enclave image. Said metadata includes a copy of the sigstruct that was generated when the enclave was signed, which is the event that triggers metadata generation. All of this means that any enclave that gets loaded effectively triggers both LSM and IMA checks. James, if you remember, the paper that we presented in Seattle described the initial implementation of an extension to the Linux IMA infrastructure that tracks whether or not processes can be 'trusted'. That work has gone on to include running the trust modeling and disciplining engine inside of a namespace specific SGX enclave. We would be happy to make available execution trajectory logs that clearly document IMA and LSM checks being conducted on enclaves. There is a strong probability that we will be maintaining and supporting a modified version of whatever driver that goes upstream. In support of this we are putting together a white paper discussing security architecture concerns inherent in an SGX driver. With the intent of avoiding LKML verbosity we will post a URL to the paper when it is available if there is interest. The issue of EDMM has already come up, suffice it to say that EDMM makes LSM inspection of enclave content, while desirable, largely irrelevant from a security perspective. > James Morris Best wishes for a productive week. Dr. Greg As always, Dr. G.W. Wettstein, Ph.D. Enjellic Systems Development, LLC. 4206 N. 19th Ave. Specializing in information infra-structure Fargo, ND 58102 development. PH: 701-281-1686 EMAIL: greg@enjellic.com ------------------------------------------------------------------------------ "If you plugged up your nose and mouth right before you sneezed, would the sneeze go out your ears or would your head explode? Either way I'm afraid to try." -- Nick Kean