Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2716902ybt; Tue, 16 Jun 2020 13:12:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZRYN1ddIbyxs0QI2WZFLyiCcxXyp5+Ei5kc4Kt48JxPoU3+Ui1syaIK+W730ESy4vt31i X-Received: by 2002:a17:906:6dcd:: with SMTP id j13mr4128471ejt.131.1592338359596; Tue, 16 Jun 2020 13:12:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592338359; cv=none; d=google.com; s=arc-20160816; b=mPCwnCmKFYZ2dD2uQ4och64Tw8ue3i6x7VsUao0+/vaPxcUb0z5iO5KfrbJ3SwS17e UF5a9QJWTQt0yBhIn5sqb+8+nzjV+SmY4lK01fMWSPMzUSfQBkofF103ZGW4nBoLF3l+ WSGrpbKPujxaBhwMAPl8HMTQrR9ZZvDriZqH7LsEuXEjpsAungJrPwbjxmmIlikhzRQl ZTnjGVXF4+XqN/NuR5g6whcGiee9j3ttAsMOR8wMofxpS3M4AycB4cX4OXUuzahaLbP8 TxKarDtJJ8FfQS5cQy8qv5VGSXiaKXn43d5RtZIYCMyH/JWzcZ1LdKj+/1/plT5gg16l Bc8Q== 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=I79q06NvBfxOO3jSXOrFVrDQ2J8SoEA2twNb51yRM8s=; b=s6tgy4amV3PUz4ooKVmAHhvwolVmb83j3nNSamf6K8CHfkbXxEF/5iXy4TqYffLfmg zb+/i1PyY8GtVMOopBlKDLEDLCJDuilUI/4nWqRzpJ7BLkvaJ9X/cBJqhizTBihPLp/n sHZRm0BT2RFSD0FbWz2VIJjY4DxHlLoHAcD+SDCc1wAllPRkBufGSCrwmN2NpFVfRe5n 0TXvPTzrBYDLv/BqPSfdRtu7wYqMOXgnXveH6RM12ty677e9Y7DtAzaZuZBvTp9VGQm1 LISUjEmh6nI3sxtZ1LsAdtrJ8yoRki2oRVECIc3pXXpYTVDTZC1Sp647y7HrsmMgN4fV 2KYQ== 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 o1si11178566edr.267.2020.06.16.13.12.16; Tue, 16 Jun 2020 13:12:39 -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 S1731348AbgFPUKK (ORCPT + 99 others); Tue, 16 Jun 2020 16:10:10 -0400 Received: from mga01.intel.com ([192.55.52.88]:13022 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727962AbgFPUKK (ORCPT ); Tue, 16 Jun 2020 16:10:10 -0400 IronPort-SDR: F1YhcCf1QQ2eKQstkSiOmMjJXlu1xh1/ONgSNtZ7tvJ015Inz/HLjzKiNZcWEjDvU7cKTGIppx nVjjEgmQUBcg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2020 13:10:09 -0700 IronPort-SDR: 3acZQnJGhOh+XvlJm6v0GvJ3UIbJLjErxgGQr7cjJuVRIjqLzOio6mQYzTQN3AqQTDa/TFvDhK okf0LgpUTI3A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,519,1583222400"; d="scan'208";a="291185078" Received: from gosinald-mobl2.ger.corp.intel.com (HELO localhost) ([10.249.36.106]) by orsmga002.jf.intel.com with ESMTP; 16 Jun 2020 13:09:59 -0700 Date: Tue, 16 Jun 2020 23:09:58 +0300 From: Jarkko Sakkinen To: Sean Christopherson Cc: linux-kernel@vger.kernel.org, x86@kernel.org, linux-sgx@vger.kernel.org, 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, luto@kernel.org, nhorman@redhat.com, npmccallum@redhat.com, puiterwijk@redhat.com, rientjes@google.com, tglx@linutronix.de, yaozhangx@google.com Subject: Re: [PATCH v32 00/21] Intel SGX foundations Message-ID: <20200616200958.GC10412@linux.intel.com> References: <20200601075218.65618-1-jarkko.sakkinen@linux.intel.com> <20200610205903.GF18790@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200610205903.GF18790@linux.intel.com> 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 Wed, Jun 10, 2020 at 01:59:03PM -0700, Sean Christopherson wrote: > On Mon, Jun 01, 2020 at 10:51:57AM +0300, Jarkko Sakkinen wrote: > > v29: > > * The selftest has been moved to selftests/sgx. Because SGX is an execution > > environment of its own, it really isn't a great fit with more "standard" > > x86 tests. > > > > The RSA key is now generated on fly and the whole signing process has > > been made as part of the enclave loader instead of signing the enclave > > during the compilation time. > > > > Finally, the enclave loader loads now the test enclave directly from its > > ELF file, which means that ELF file does not need to be coverted as raw > > binary during the build process. > > Something in the above rework broke the selftest. I'm getting intermittent > EINIT failures with SGX_INVALID_SIGNATURE. I'm guessing it's related to > the dynamic RSA key generation, e.g. only ~15% of runs fail. Verified that > v29 selftest fails and v28 passes. My internal tests also pass, i.e. it's > all but guaranteed to be a selftest issue, not a kernel issue. > > Jarkko, I don't have bandwidth to dig into this right now, hopefully this > reproduces in your environment. Let me know if that's not the case. I haven't experienced but I'll try to stress test it. Just to know how complex test should reproduce your issue, can you reproduce the issue by running the selftest sequentially in a loop or do I need to do something more complex than that? /Jarkko