Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp597484ybl; Thu, 23 Jan 2020 04:34:00 -0800 (PST) X-Google-Smtp-Source: APXvYqysxAnlEA08zeD/X+bs8vPrETC/jLU1WOYHqyv85VXeN1HS4K2NqvLvDrogECjRAy1QX+5v X-Received: by 2002:aca:af54:: with SMTP id y81mr10258370oie.21.1579782840507; Thu, 23 Jan 2020 04:34:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579782840; cv=none; d=google.com; s=arc-20160816; b=ZExrnxFWhnq7x8ma4xwrWZ1G8wGWEHWcXpC9yfdwNH3xpKaLynoyt/K7FsG7hD6HJu dte1kyqPMDUkBG+As4hjg3fgGDahK08DALJ/BxyHqtpE00SKF1RZu7i+kbtSbMUohRES GFlS6nkdiJLBAgBpnSv1cQOObvVyvKI1mGejW7ZwJUi7QD2WMmBi5HeeFIAYZtPieHKS qsWjm3fLvSEI1z17v1Cy972fQMSbFq4OfnejSF/QcIfi+pryrBCITElD5IvPaDTE8fPU sMqEbIcpKcWv0dMXlVZ/RvBMHBSf1TXHQLUr1IDfmnH7/You1VOdM5UTFK15QBXnjOYT VebQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:organization:references:in-reply-to:date:cc:to:from :subject:message-id; bh=0nVrd/IV5rQj+zZKgFQP8Alt2JpiL0Y7byQBjWF5lBs=; b=0ZssozZgJDXBQIT/UDbCGoMINzNCRyXQIK1v4VZzcRoKYeV3UPN61Lsak1fCpCmmY5 /v+Tq31tugBgqOLZTRsz3/lPb3YgImosx9jZii6QFNEpIpJxnLqkhlM/cB8B9G0kNruE 5/ovA31SW7vxJ7Qo4AFGRB3wtMUjRWozdqwJrQc9RkN+sdnwwbQeLVjKxVJNTECBnKaz TQAEwNoh4G8vw8/kZb3R2WmwpD1meQHy9weMRK6r/XXltT8pgn5cGl2WK31eJCzBZuEX ZyMConnWVoZP4kBbMP4iW5aEG9ECsHxUMG9xa2wQav5Cg9IEI+viQn0712QG4fXnl7vQ vSSw== 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 h203si818560oif.3.2020.01.23.04.33.48; Thu, 23 Jan 2020 04:34:00 -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 S1728939AbgAWMbs (ORCPT + 99 others); Thu, 23 Jan 2020 07:31:48 -0500 Received: from mga18.intel.com ([134.134.136.126]:63130 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726191AbgAWMbs (ORCPT ); Thu, 23 Jan 2020 07:31:48 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Jan 2020 04:31:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,353,1574150400"; d="scan'208";a="220652634" Received: from wkalinsk-mobl.ger.corp.intel.com ([10.252.23.16]) by orsmga008.jf.intel.com with ESMTP; 23 Jan 2020 04:31:37 -0800 Message-ID: <850ecd66bf6f0bf59aa96e93f664bbe571c91009.camel@linux.intel.com> Subject: Re: [PATCH v24 12/24] x86/sgx: Linux Enclave Driver From: Jarkko Sakkinen To: haitao.huang@linux.intel.com, linux-kernel@vger.kernel.org, x86@kernel.org, linux-sgx@vger.kernel.org Cc: akpm@linux-foundation.org, dave.hansen@intel.com, sean.j.christopherson@intel.com, nhorman@redhat.com, npmccallum@redhat.com, serge.ayoun@intel.com, shay.katz-zamir@intel.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, Suresh Siddha Date: Thu, 23 Jan 2020 14:31:36 +0200 In-Reply-To: References: <20191129231326.18076-1-jarkko.sakkinen@linux.intel.com> <20191129231326.18076-13-jarkko.sakkinen@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.1-2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2020-01-14 at 10:12 -0600, Haitao Huang wrote: > On Fri, 29 Nov 2019 17:13:14 -0600, Jarkko Sakkinen > wrote: > > > +static int sgx_encl_init(struct sgx_encl *encl, struct sgx_sigstruct > > *sigstruct, > > + struct sgx_einittoken *token) > > +{ > > + u64 mrsigner[4]; > > + int ret; > > + int i; > > + int j; > > + > > + /* Check that the required attributes have been authorized. */ > > + if (encl->secs_attributes & ~encl->allowed_attributes) > > + return -EINVAL; > > + > > EACCES to be more specific? I'd say it'd be especially since it is our artificial access control check and not something directly in the uarch. Thanks for the remark I updated my master branch. /Jarkko