Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3663186yba; Tue, 23 Apr 2019 07:35:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqzJyN6pqY9XpeP8XftR1LwKbQQ0BltOi3mK782OB5D77bpetakbK1eWvU92hCor1dNGmtNA X-Received: by 2002:a17:902:463:: with SMTP id 90mr26863383ple.140.1556030153021; Tue, 23 Apr 2019 07:35:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556030153; cv=none; d=google.com; s=arc-20160816; b=h5rJke9LKnJbMY4S90PpLgoLArUKb5vUA4fnJYU9WkfZeNzp1Uc2CQvPlUG7Ir1WB/ ESIgIglbJuT56hb4BhFN0svUCdmY/8maSJOXJn14lbK6cX5A2ukf2XX9jih24MfhzaSE zBx6R7kIhM6LZmzNuf0M3Hedvd4bDvp9yZJ1P1ejzJaTyEfqz6nf/OckdQ3ib0KPmvYx ixkyAU+hF+mLPjxxo3jVE/EDm24Sp4x4mH3aPISE3k8+MlyXrSMxxOY028Hgoour14At vfnMtXiXt+llnmQz95xeakXyO91S6v0X1uwXPGRk0Ht0F89LlTtDcdxgNx7o4wAjUTn9 5C3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=W/Hv9quvWxlcXoJpSOCIl+wV7kXzPFr8fCwrQ2UAt4k=; b=LNW0SYVz4/w6kYU46JJF5/npy5j39e7EyPVkxzd8ma02joBifJsMe5I4JCKLc7rCHT mTc931RBSL2B94G337PJz+A+M7hY6ggQ8N6/OpIe9nt7Oo66kMRB1URoh328t060JBnP kP2/OGh+hqzZ5mIM+s/zblaaL8UFbuivzS30c6z3FmToiu18N5KHBXt5V+qK2b6BgU05 246CmvN7LWIejAlGL/gVx1tn/eqnc4MhqxLi0FtetzuUJc9vb5CrPkjjQfNRtu/6bIH3 MGL+tTbF1O7CywNWAnwkcX3mRUcSoGadq0joiIXm/FUTHllg69yHdyCZi6JYXElNjYSr JIVA== 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 r16si10462127pgv.503.2019.04.23.07.35.36; Tue, 23 Apr 2019 07:35:53 -0700 (PDT) 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 S1727954AbfDWOd0 (ORCPT + 99 others); Tue, 23 Apr 2019 10:33:26 -0400 Received: from mga04.intel.com ([192.55.52.120]:59062 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726421AbfDWOdZ (ORCPT ); Tue, 23 Apr 2019 10:33:25 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP; 23 Apr 2019 07:33:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,386,1549958400"; d="scan'208";a="138092169" Received: from sbwarrax-mobl1.gar.corp.intel.com (HELO localhost) ([10.252.58.123]) by orsmga006.jf.intel.com with ESMTP; 23 Apr 2019 07:33:11 -0700 Date: Tue, 23 Apr 2019 17:33:09 +0300 From: Jarkko Sakkinen To: "Huang, Kai" Cc: "linux-kernel@vger.kernel.org" , "linux-sgx@vger.kernel.org" , "x86@kernel.org" , "Svahn, Kai" , "nhorman@redhat.com" , "jmorris@namei.org" , "Christopherson, Sean J" , "josh@joshtriplett.org" , "tglx@linutronix.de" , "Ayoun, Serge" , "Huang, Haitao" , "linux-security-module@vger.kernel.org" , "akpm@linux-foundation.org" , "npmccallum@redhat.com" , "rientjes@google.com" , "luto@kernel.org" , "Katz-zamir, Shay" , "Hansen, Dave" , "bp@alien8.de" , "serge@hallyn.com" , "andriy.shevchenko@linux.intel.com" Subject: Re: [PATCH v20 16/28] x86/sgx: Add provisioning Message-ID: <20190423143309.GB26642@linux.intel.com> References: <20190417103938.7762-1-jarkko.sakkinen@linux.intel.com> <20190417103938.7762-17-jarkko.sakkinen@linux.intel.com> <1555643200.2776.1.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1555643200.2776.1.camel@intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 19, 2019 at 03:06:48AM +0000, Huang, Kai wrote: > On Wed, 2019-04-17 at 13:39 +0300, Jarkko Sakkinen wrote: > > In order to provide a mechanism for devilering provisoning rights: > > > > 1. Add a new device file /dev/sgx/provision that works as a token for > > allowing an enclave to have the provisioning privileges. > > 2. Add a new ioctl called SGX_IOC_ENCLAVE_SET_ATTRIBUTE that accepts the > > following data structure: > > > > struct sgx_enclave_set_attribute { > > __u64 addr; > > __u64 attribute_fd; > > }; > > > > A daemon could sit on top of /dev/sgx/provision and send a file > > descriptor of this file to a process that needs to be able to provision > > enclaves. > > > > The way this API is used is straight-forward. Lets assume that dev_fd is > > a handle to /dev/sgx/enclave and prov_fd is a handle to > > /dev/sgx/provision. You would allow SGX_IOC_ENCLAVE_CREATE to > > initialize an enclave with the PROVISIONKEY attribute by > > > > params.addr = ; > > params.token_fd = prov_fd; > > > Should be params.attribute_fd = prov_fd; > > Thanks, > -Kai Thanks. /Jarkko