Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1964981ybt; Thu, 2 Jul 2020 19:34:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+NJeAkEAGbxsi4IaTo2YA95qk9jgd3SyVloZt0JoolNanimy2eUMBSeJZg04zUTx7y9Au X-Received: by 2002:a05:6402:cb9:: with SMTP id cn25mr26356983edb.247.1593743688569; Thu, 02 Jul 2020 19:34:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593743688; cv=none; d=google.com; s=arc-20160816; b=uVlga+fjX3nftPKmcDgodX1zc5C49VVYehWwCWQ1lA2eDxETFnO4bzVcRo9lsz+12e lI3ybaDK79SEjquvJL5fiZ0ahEi+tbBiOlh/fql9cRotaaf+WRiuRHuu4sbw0L+9Tjs+ AMQVnsIga3oM0BnkvQ+rGrNgYb+gSR/oXrRjktzjlTMBqyhz8tDWdFd3QJMgmvqm4aQq gbC7UwWt5bKyJq5tJBknHESCrYANAj1/xMOhJXLoVvuHIKzDX6jEFFGHYzpqsvnvDr4P GSwy3JynyOb5Uq5WHZZNDW/uEosZbDupF5lttRbEt/JoySnFbygvl253EZAG9P5IOtBk IJhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=7CdgMTA5x5NOrHXzx0s8jl8lIpW05VaTHI3PRajKrb8=; b=WUKSXMyKl0OkTmxPOpjLNS6py9M9U6zo9dsp1EB60mU5bu5vU/8rAyeXOIid3x5Prb DoWnJMJ+uPkpttvZ7PiutK0y/YE9siysYuWc0caAiQVKbCFfzUZ7XUScW3fExP/7Ltju OBLfBLhIZBvGQvKJeLlm+tDHvq7ko2YfqW+ZwTMgof0Ps6EQZLYdv3vpLzEefUvW62l2 kltfcHwHY289NfKe6Xu8cdgXnZxn71xpQm6JCIKOdyGXaT+JHD1uWHZKfMe91wNYDO+r +Vcez623btUtblwr59BrXOBZXz1e15xTz8VpuNPukjvpWCHKhR4Sgh7dxyUMdfWu4IxV VK+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id dk28si6803201edb.425.2020.07.02.19.34.24; Thu, 02 Jul 2020 19:34:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726065AbgGCCc3 (ORCPT + 99 others); Thu, 2 Jul 2020 22:32:29 -0400 Received: from mga12.intel.com ([192.55.52.136]:24277 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725915AbgGCCc2 (ORCPT ); Thu, 2 Jul 2020 22:32:28 -0400 IronPort-SDR: YA7Xnsze6pmgAkxD8RK3+hjz/2ED5jehk5TuOwIZw/2BR5uiWGyuLuh+yCnoAjUTUsfoU3gGNF F11/4KeSPUnA== X-IronPort-AV: E=McAfee;i="6000,8403,9670"; a="126682907" X-IronPort-AV: E=Sophos;i="5.75,306,1589266800"; d="scan'208";a="126682907" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2020 19:32:28 -0700 IronPort-SDR: nNQGXlodZBsiyF7oNmMJC04fBdPJEqP6YcTfyXBJqnlbD2TiZfMJqMh12whCQxg4wZhnlMP8ud KxH23C3FwspA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,306,1589266800"; d="scan'208";a="278294996" Received: from skochetx-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.55.66]) by orsmga003.jf.intel.com with ESMTP; 02 Jul 2020 19:32:17 -0700 Date: Fri, 3 Jul 2020 05:32:16 +0300 From: Jarkko Sakkinen To: Borislav Petkov Cc: x86@kernel.org, linux-sgx@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, Jethro Beekman , Andy Lutomirski , akpm@linux-foundation.org, andriy.shevchenko@linux.intel.com, asapek@google.com, cedric.xing@intel.com, chenalexchen@google.com, conradparker@google.com, cyhanish@google.com, dave.hansen@intel.com, haitao.huang@intel.com, josh@joshtriplett.org, kai.huang@intel.com, kai.svahn@intel.com, kmoy@google.com, ludloff@google.com, nhorman@redhat.com, npmccallum@redhat.com, puiterwijk@redhat.com, rientjes@google.com, sean.j.christopherson@intel.com, tglx@linutronix.de, yaozhangx@google.com Subject: Re: [PATCH v33 12/21] x86/sgx: Allow a limited use of ATTRIBUTE.PROVISIONKEY for attestation Message-ID: <20200703023146.GA306897@linux.intel.com> References: <20200617220844.57423-1-jarkko.sakkinen@linux.intel.com> <20200617220844.57423-13-jarkko.sakkinen@linux.intel.com> <20200629160242.GB32176@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200629160242.GB32176@zn.tnic> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 29, 2020 at 06:02:42PM +0200, Borislav Petkov wrote: > On Thu, Jun 18, 2020 at 01:08:34AM +0300, Jarkko Sakkinen wrote: > > Provisioning Certification Enclave (PCE), the root of trust for other > > enclaves, generates a signing key from a fused key called Provisioning > > Certification Key. PCE can then use this key to certify an attestation key > > of a QE, e.g. we get the chain of trust down to the hardware if the Intel > > What's a QE? > > I don't see this acronym resolved anywhere in the whole patchset. Quoting Enclave. > > > signed PCE is used. > > > > To use the needed keys, ATTRIBUTE.PROVISIONKEY is required but should be > > only allowed for those who actually need it so that only the trusted > > parties can certify QE's. > > > > Obviously the attestation service should know the public key of the used > > PCE and that way detect illegit attestation, but whitelisting the legit > > users still adds an additional layer of defence. > > > > Add new device file called /dev/sgx/provision. The sole purpose of this > > file is to provide file descriptors that act as privilege tokens to allow > > to build enclaves with ATTRIBUTE.PROVISIONKEY set. A new ioctl called > > SGX_IOC_ENCLAVE_SET_ATTRIBUTE is used to assign this token to an enclave. > > So I'm sure I'm missing something here: what controls which > enclave can open /dev/sgx/provision and thus pass the FD to > SGX_IOC_ENCLAVE_SET_ATTRIBUTE? > > And in general, how does that whole flow look like: what calls > SGX_IOC_ENCLAVE_SET_ATTRIBUTE when? I've documented it in the Remote Attestation section: https://github.com/jsakkine-intel/linux-sgx/blob/master/Documentation/x86/sgx.rst /Jarkko