Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1979180ybv; Fri, 14 Feb 2020 09:13:19 -0800 (PST) X-Google-Smtp-Source: APXvYqy8MmmO4y6qz+ZqIkGDWxobqWC5kuhifjXXdH412rmc5RcMn0bGuYJ1AFoLLVR665mDkb+7 X-Received: by 2002:a9d:1c96:: with SMTP id l22mr3167811ota.322.1581700399417; Fri, 14 Feb 2020 09:13:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581700399; cv=none; d=google.com; s=arc-20160816; b=MBXmty2EmC6Ud7TYCSp7aaK/NkcfrvBg2XgowK1tfl5FwjvhZwmfiZEn84wDwrFskJ 9jRbGx0v79H4/RAeacANNDIQ1a0MJbrMrno8WwhfoFZiDcYtQTcDwEnwcVtVXnPklO5N YhEHWuPMIQXKtQKWpCqv2eRrPVBkH4ij0/E7b3Eh5wso0r6GzSw5FUWcMHNLXi/+dZyr ewBA6eM1gmwFiPgI0mJRYDw+J58tR8qIFsefpfrZ374sViD/5bCc7elyGMaeOLkhCF8D ka6Ye+Sh8wZCJdrQR6L394SIRt1xUBttXPER1GiRpzFhMkraVtpFHERXWlck8cdvFFP2 aR2g== 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=nmA9tR1hAyY/1T+5u2jgZ+ZYdgcx5CcUjY6V7shv7TI=; b=qPgPgINpEs+Hj5W6BLnhBEyGwOU/rSHYck0gAyUPTEvPNQsO1umLnKrh2ZzekyHznb B/9yE1Ysa9U9C6gb3+URZf4MSx9wUb2DW/OwZOP2YGCzslubbCbStcu/mp/Uw/7BmdO2 LsJ/2BShUT0eky6OAjkl6D5+NakEazJ6tryIBnDU1qUwCrW/+Hq7o+8bLve7Fu8hhiD1 ZrCLCJRRQ+oang/Vot4KGQ2sHWJFKK0N9SfaFFC70QgY2aEi6kk6YoY2uf3NwtUn1cVD fONmg2tnZyJjt7I9fFzjZbpmzR6ZIDWCB2MMj8J6PnCPpoVWUorHttihvqevXYOCyKQb n/Wg== 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 s16si3301414otq.253.2020.02.14.09.13.07; Fri, 14 Feb 2020 09:13:19 -0800 (PST) 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 S2403861AbgBNRLu (ORCPT + 99 others); Fri, 14 Feb 2020 12:11:50 -0500 Received: from mga06.intel.com ([134.134.136.31]:10329 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394490AbgBNRLr (ORCPT ); Fri, 14 Feb 2020 12:11:47 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Feb 2020 09:11:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,441,1574150400"; d="scan'208";a="234517959" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.202]) by orsmga003.jf.intel.com with ESMTP; 14 Feb 2020 09:11:46 -0800 Date: Fri, 14 Feb 2020 09:11:46 -0800 From: Sean Christopherson To: Jethro Beekman Cc: Jarkko Sakkinen , linux-kernel@vger.kernel.org, x86@kernel.org, linux-sgx@vger.kernel.org, akpm@linux-foundation.org, dave.hansen@intel.com, nhorman@redhat.com, npmccallum@redhat.com, haitao.huang@intel.com, andriy.shevchenko@linux.intel.com, tglx@linutronix.de, kai.svahn@intel.com, bp@alien8.de, josh@joshtriplett.org, luto@kernel.org, kai.huang@intel.com, rientjes@google.com, cedric.xing@intel.com, puiterwijk@redhat.com, linux-security-module@vger.kernel.org, Haitao Huang Subject: Re: [PATCH v26 10/22] x86/sgx: Linux Enclave Driver Message-ID: <20200214171146.GD20690@linux.intel.com> References: <20200209212609.7928-1-jarkko.sakkinen@linux.intel.com> <20200209212609.7928-11-jarkko.sakkinen@linux.intel.com> <20200213180737.GC18610@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 Fri, Feb 14, 2020 at 10:24:10AM +0100, Jethro Beekman wrote: > On 2020-02-13 19:07, Sean Christopherson wrote: > > On Thu, Feb 13, 2020 at 02:59:52PM +0100, Jethro Beekman wrote: > >> On 2020-02-09 22:25, Jarkko Sakkinen wrote: > >>> +/** > >>> + * struct sgx_enclave_add_pages - parameter structure for the > >>> + * %SGX_IOC_ENCLAVE_ADD_PAGE ioctl > >>> + * @src: start address for the page data > >>> + * @offset: starting page offset > >>> + * @length: length of the data (multiple of the page size) > >>> + * @secinfo: address for the SECINFO data > >>> + * @flags: page control flags > >>> + * @count: number of bytes added (multiple of the page size) > >>> + */ > >>> +struct sgx_enclave_add_pages { > >>> + __u64 src; > >>> + __u64 offset; > >>> + __u64 length; > >>> + __u64 secinfo; > >>> + __u64 flags; > >>> + __u64 count; > >>> +}; > >> > >> Compared to the last time I looked at the patch set, this API removes the > >> ability to measure individual pages chunks. That is not acceptable. > > > > Why is it not acceptable? E.g. what specific use case do you have that > > _requires_ on measuring partial 4k pages of an enclave? > > The use case is someone gives me an enclave and I want to load it. If I don't > load it exactly as the enclave author specified, the enclave hash will be > different, and it won't work. And if our ABI says "thou shall measure in 4k chunks", then it's an invalid enclave if its author generated MRENCLAVE using a different granularity.