Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2006428ybv; Fri, 14 Feb 2020 09:40:38 -0800 (PST) X-Google-Smtp-Source: APXvYqw+4280fNSDBGsuDP7ot4PH4WRNThmpdNvJavwthufMPYH7K9Bf3iI+1BDEdi4KGA6fz/Ch X-Received: by 2002:a05:6808:a11:: with SMTP id n17mr2594706oij.94.1581702038627; Fri, 14 Feb 2020 09:40:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581702038; cv=none; d=google.com; s=arc-20160816; b=RkgALGZz3s9+UH13+cYYlcSeKB7l57h+bsVdag19QVW1cPmQI/iEu5EoXDKiuPFG+e BSp2feVy4cmWcmjsP5mivSeqcfF6Kd0AXgRGQq3CmnyXxnQT0rlMyJNM8jhGxg4+R5DF GIwH8vodb565cOB9SdYEq7flPeqJ79LOcdADtesmEZFfvj/VW9n1/nFVN4/Ith1oQwiY Mn8c2D20LdWPJCwsKVMbLLw6tXLNsXlpvxvPSbO4ifasRzGatbhiL3maYUf2CJZcCbCM s62yHCB2dso4OvKAY/y+r2LNC8vLdHdtkCz/Ku6flnMXZ/Hpb9AuromWnbfxnYsoaDZ1 z3vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:in-reply-to:cc:references:message-id :date:subject:mime-version:from:content-transfer-encoding :dkim-signature; bh=3eXuOgfEolpkZ5hPj8gcQuPTURlTdrMwkoy/D3yOIvc=; b=zvtv0Uq4zHNLPncdQJtRCzPZcFpeQWfecGkZaTYiu66sPeqFONVoFQu8Q9XJpJ/syv X8HoLoVHdUs3Ox+CZKiSLM8YGTrs6SElSCeR0SG75hIz4ximIeA/2uKAQ8bXKdeU/9x6 DxFP7iTxSP/4Ds2dLPoK6jykUTG+noF3/jgy34aK2/Vopw4zmdEeTL1Bz07F/K5FyDmI 0U5HTLcYIkXxBgfH93TnDnvBRJDzt2jTu56pf63V7vByIcORbMV93icgiaxoQqWKY/QZ jIh+FZs+L/EdezB8MoYVIwTBbOY6AKAFNhHkewJXlB3IKFByPkFRYL6YemfAv5WB9wNo Gxow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=scFiUdiF; 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 k19si3213814otp.33.2020.02.14.09.40.26; Fri, 14 Feb 2020 09:40:38 -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; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=scFiUdiF; 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 S1730599AbgBNRkK (ORCPT + 99 others); Fri, 14 Feb 2020 12:40:10 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:43400 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390001AbgBNRkI (ORCPT ); Fri, 14 Feb 2020 12:40:08 -0500 Received: by mail-pf1-f193.google.com with SMTP id s1so5204946pfh.10 for ; Fri, 14 Feb 2020 09:40:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=3eXuOgfEolpkZ5hPj8gcQuPTURlTdrMwkoy/D3yOIvc=; b=scFiUdiFkMp38HNXCebJUGM5/Xev4sTfpdTyi+eIORpvxEE0NyI4nWVBHUHdSXuU5d RiPBBexlo3EQIACh+gtrdkaprcMAxzHOwE42W3z3TOHhCccOugoonMcadDsGExGx24pZ H5/pvCKDjTt4FVP9c5g/C0+RgXXbdQ1Xqk7FmQlbb6AZ5h2ILWTjgqWfIwcHgBV+L7JY TSCYm2FabsMtQ8YOEMv0D3S/L1piI0FOoF1PWbmE6EHuG+gpgg4BZW4kiiK6A07bGmUH FXPJ4y0WsutSbFR4CDk3jDnnfWv6EdKE+piowBnqUmvtaAu45SrnpvEWExNeyJp8gdnO cUZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=3eXuOgfEolpkZ5hPj8gcQuPTURlTdrMwkoy/D3yOIvc=; b=dNATy7JcztwBej+gshkzlnMNcKY31OhOj8UuAMRFLkSpJohh8CzAhIMcOZBne4Gjev VLEjpkKeTFrB7pQFkMjPrSyp9vo1Gd1M3G02tG7KyL1ralk0kLAR42wL8aj31LkSNTW8 iEYtUJWRFEI1PiSSjUqjn1jLZJ3N74AcUoypWPTAh9oj+ypZtwQrYC3y95ypde7ofnQv JqNMoCB49zwiam8BFmYQGL5mnMd3DS3t+75CDEKCU05DUUHHqEnoJRWVTV1E6HUQpSih gc5lISyl2nbudPAloARrIERBOFdwZjGKKEF2BMDL4X/IClZwZyHwJlscmpCC8ej58hxW X02w== X-Gm-Message-State: APjAAAXx05Bju9qPV+/WL4NjkYTzsob+MP8ibn+ws/Tj9K8Tj7jZe17R aSdJmo6r2GxjhVAhDLiVMBbskg== X-Received: by 2002:a63:f40d:: with SMTP id g13mr4919987pgi.374.1581702007228; Fri, 14 Feb 2020 09:40:07 -0800 (PST) Received: from ?IPv6:2600:1010:b013:3558:61dd:b73f:191c:9246? ([2600:1010:b013:3558:61dd:b73f:191c:9246]) by smtp.gmail.com with ESMTPSA id h3sm7424340pfo.102.2020.02.14.09.40.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 14 Feb 2020 09:40:06 -0800 (PST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Andy Lutomirski Mime-Version: 1.0 (1.0) Subject: Re: [PATCH v26 10/22] x86/sgx: Linux Enclave Driver Date: Fri, 14 Feb 2020 09:40:00 -0800 Message-Id: References: <20200214171146.GD20690@linux.intel.com> Cc: Jethro Beekman , 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 In-Reply-To: <20200214171146.GD20690@linux.intel.com> To: Sean Christopherson X-Mailer: iPhone Mail (17D50) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Feb 14, 2020, at 9:11 AM, Sean Christopherson wrote: >=20 > =EF=BB=BFOn 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; >>>>> +}; >>>>=20 >>>> Compared to the last time I looked at the patch set, this API removes t= he >>>> ability to measure individual pages chunks. That is not acceptable. >>>=20 >>> Why is it not acceptable? E.g. what specific use case do you have that >>> _requires_ on measuring partial 4k pages of an enclave? >>=20 >> The use case is someone gives me an enclave and I want to load it. If I d= on't >> load it exactly as the enclave author specified, the enclave hash will be= >> different, and it won't work. >=20 > And if our ABI says "thou shall measure in 4k chunks", then it's an invali= d > enclave if its author generated MRENCLAVE using a different granularity. ISTM, unless there=E2=80=99s a particularly compelling reason, if an enclave= is valid, we should be able to load it.=