From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BC9CC4727F for ; Wed, 23 Sep 2020 13:44:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BD872221F0 for ; Wed, 23 Sep 2020 13:44:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD872221F0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 460026B005D; Wed, 23 Sep 2020 09:44:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 40F316B0062; Wed, 23 Sep 2020 09:44:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2D75E6B0068; Wed, 23 Sep 2020 09:44:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 16E336B005D for ; Wed, 23 Sep 2020 09:44:04 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id C6673180AD804 for ; Wed, 23 Sep 2020 13:44:03 +0000 (UTC) X-FDA: 77294444766.18.class43_450d16a27156 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id A02771013BB0C for ; Wed, 23 Sep 2020 13:44:03 +0000 (UTC) X-HE-Tag: class43_450d16a27156 X-Filterd-Recvd-Size: 4377 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by imf32.hostedemail.com (Postfix) with ESMTP for ; Wed, 23 Sep 2020 13:44:02 +0000 (UTC) IronPort-SDR: 156TOyV8e3FWwc19KwT4J4OtuoqF6Wj+pvEhekVHa9fb+pIVpWPEKYIN60wwZT7ZuGzAaYpetH T50W8M0w3KuQ== X-IronPort-AV: E=McAfee;i="6000,8403,9752"; a="158242370" X-IronPort-AV: E=Sophos;i="5.77,293,1596524400"; d="scan'208";a="158242370" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2020 06:44:01 -0700 IronPort-SDR: Lme8ty7I/g9PsqiJtR4D47YuMqBd6NyLtzEbVFSirhG42hpuJfcvDa0Pv2wpB7D/5OOvaVoo9X 8JjxHTb7FwpQ== X-IronPort-AV: E=Sophos;i="5.77,293,1596524400"; d="scan'208";a="486445607" Received: from ichiojdo-mobl.ger.corp.intel.com (HELO localhost) ([10.252.51.82]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2020 06:43:54 -0700 Date: Wed, 23 Sep 2020 16:43:52 +0300 From: Jarkko Sakkinen To: Dave Hansen Cc: Andy Lutomirski , Sean Christopherson , Andy Lutomirski , X86 ML , linux-sgx@vger.kernel.org, LKML , Linux-MM , Andrew Morton , Matthew Wilcox , Jethro Beekman , Darren Kenny , Andy Shevchenko , asapek@google.com, Borislav Petkov , "Xing, Cedric" , chenalexchen@google.com, Conrad Parker , cyhanish@google.com, "Huang, Haitao" , Josh Triplett , "Huang, Kai" , "Svahn, Kai" , Keith Moyer , Christian Ludloff , Neil Horman , Nathaniel McCallum , Patrick Uiterwijk , David Rientjes , Thomas Gleixner , yaozhangx@google.com Subject: Re: [PATCH v38 10/24] mm: Add vm_ops->mprotect() Message-ID: <20200923134352.GC5160@linux.intel.com> References: <20200918235337.GA21189@sjchrist-ice> <1B23E216-0229-4BDD-8B09-807256A54AF5@amacapital.net> <20200922125801.GA133710@linux.intel.com> <25d46fdc-1c19-2de8-2ce8-1033a0027ecf@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <25d46fdc-1c19-2de8-2ce8-1033a0027ecf@intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Sep 22, 2020 at 08:11:14AM -0700, Dave Hansen wrote: > On 9/22/20 5:58 AM, Jarkko Sakkinen wrote: > > Intel Sofware Guard eXtensions (SGX) allows creation of executable blobs > > called enclaves, of which page permissions are defined when the enclave > > "of which" => "for which" > > > is first loaded. Once an enclave is loaded and initialized, it can be > > mapped to the process address space. > > Could you compare and contrast this a *bit* with existing executables? > What's special about SGX? ELF executables have page permissions inside > the binary too. Why don't we use this mechanism for them? There is no standard file format for enclaves. They are dynamically built. And the way enclaves are used as part of an app and throwing container inside enclave differ. A single format would no work too well for all possible use cases. I cannot formally prove this of course but it is highly unlikely that we could ever define such a format. Thus, the security focus is allow to verify from origin. And the existing ecosystem around SGX is already too large to suddenly move to a single format. User base, I guess, is also an argument. This is not yet mainline code so technically we have zero ABI debt but I still think this is a valid point because SGX is already widely used. I'm not really sure what would be the best way to nail this information to the commit message but I'll try to figure out something before I send the next version of the patch set. /Jarkko