Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2707121ybt; Tue, 16 Jun 2020 12:57:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6X9ixZFYEXnbfJdjvClwxHJhiVi5yWsI9ajkcGO8YG7FbI4H+HisHwpmD7r16mHrkqiG3 X-Received: by 2002:a17:906:e0c:: with SMTP id l12mr4173724eji.435.1592337465347; Tue, 16 Jun 2020 12:57:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592337465; cv=none; d=google.com; s=arc-20160816; b=I/lJ9DFjhyrWKb5+sIMtKfYCfvtAJUv2V5yRxfZkHtB0Bi4Te6lTwMHV4ncnX62Es2 bPTHfEFJWs/4WJllzCUBu8heSn8zn8qFssstTvDm9u75dbMxR1zeslHdOwQ420hUoT0F p4OZDFm45OHi0mxBwUvkMRY0IyuEvGZo06/DDSvjvvIwho5liyJnkYQc8kpd/KW9al26 m7FoVFVK6/dAzUp8eCrHeiHhS0ZmthmbrXE8ETUutGaFGQjxtnJVOEVK/oRh1mf0kFfd yhn1tgXj0K9Y7TgXhFpSgckRN/hkxOvRk25vehKxmtYcoiq5Odl32+makY0oM6xJ9c44 Dj5A== 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=Uy7PSlDfXUtYpYkTYvpUd3K6gBrAf9yQoziKZWsc91Q=; b=P9vwXOFaJHZi824BOYc+hoT+ReKL9051/Ut3W2HhfZfDDgrWdPe02fCjRO5/I3RU2I FS+zFB1hhR+Xpzd0nsIElrM0yTOmN+xeZsXj4hrXlY3x1lV5lCxR+Fs7zuauRXntWBd1 g1lT+s12p+/kze+bvMjiuxLbImVsA/bmJ7v2L0q22I8DU/PD8ymoHS9YJfs+eyISzASZ zc2Z04jT4qx/mjZAl41/TAMVxP/Uogk6vICIboZ1HSryqIp9l8IKVyCR0RW6tZo4h4NH dIGST2lqBBj/TdZNbb3x7UhlQDXddaUM5aN3m4mmBOo2f0TzNKeGyf/kXZrCLZr7Nfkm M1fQ== 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 v5si11691418ejj.410.2020.06.16.12.57.17; Tue, 16 Jun 2020 12:57:45 -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 S1731069AbgFPTzN (ORCPT + 99 others); Tue, 16 Jun 2020 15:55:13 -0400 Received: from mga02.intel.com ([134.134.136.20]:48548 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728144AbgFPTzM (ORCPT ); Tue, 16 Jun 2020 15:55:12 -0400 IronPort-SDR: UgDqcUaBH6Z7j6RuDAbiTo7J5JXCtj8Tt3Flr6Zb1nQ0G/Qe43UBianefvjnxKMyye+ZugLHp3 E55JWHqvCjxA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2020 12:55:11 -0700 IronPort-SDR: L9wi8U+03tTN6+vKwsCFCPmfXUX6scD66uycNs5QT+D0rVy04+ilW32NFUDhSPvD3YJ07a0Cbt Pu/Re4MQ226Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,519,1583222400"; d="scan'208";a="261519323" Received: from gosinald-mobl2.ger.corp.intel.com (HELO localhost) ([10.249.36.106]) by fmsmga007.fm.intel.com with ESMTP; 16 Jun 2020 12:55:02 -0700 Date: Tue, 16 Jun 2020 22:55:01 +0300 From: Jarkko Sakkinen To: Darren Kenny Cc: linux-kernel@vger.kernel.org, x86@kernel.org, linux-sgx@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, bp@alien8.de, 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 v32 12/21] x86/sgx: Add provisioning Message-ID: <20200616195450.GA10412@linux.intel.com> References: <20200601075218.65618-1-jarkko.sakkinen@linux.intel.com> <20200601075218.65618-13-jarkko.sakkinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Fri, Jun 05, 2020 at 09:09:49PM +0100, Darren Kenny wrote: > TYPO: s/devilering/delivering/? I decided to rewrite the whole thing: x86/sgx: Allow a limited use of ATTRIBUTE.PROVISIONKEY for attestation 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 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. > > + * sgx_ioc_enclave_set_attribute - handler for %SGX_IOC_ENCLAVE_SET_ATTRIBUTE > > + * @filep: open file to /dev/sgx > > + * @arg: userspace pointer to a struct sgx_enclave_set_attribute instance > > + * > > + * Mark the enclave as being allowed to access a restricted attribute bit. > > + * The requested attribute is specified via the attribute_fd field in the > > + * provided struct sgx_enclave_set_attribute. The attribute_fd must be a > > + * handle to an SGX attribute file, e.g. ?/dev/sgx/provision". > > Maybe this should be simply a double-quote rather than the Unicode left > quote? Not sure how that got there but it is a mistake. > Thanks, > > Darren. Thanks for the remarks. /Jarkko