Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp79056ybt; Tue, 16 Jun 2020 17:09:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxc0NOBuPGuP0bfbtKy6TGyL/tmAUh/oVzBIssFJvN40bJMWX2EG6wQnm2rUOUP3gX66cAy X-Received: by 2002:a17:906:2e50:: with SMTP id r16mr4935596eji.305.1592352562286; Tue, 16 Jun 2020 17:09:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592352562; cv=none; d=google.com; s=arc-20160816; b=VwiVqhqerFyHI0xZ+aSz/ODE2GsaswTl8jJ2adR0qKlMKjTmtV+Y5BOHMM9bm6Tf1b 14p55aXZ0T64vmyODofMlab+glUIEBG7bkVNiZ0wPV0WCBXxYzYVdexFHMfs7JnrSbO1 o5I49FAyjKAoG2kIjCK1znqrlsqiWlxQrsy3MODvSUjxHcxBHzhxORdT2nA+/xLjL/oi 56prWepWrrvSATRkCwR2P2tANZD9eU0ohthVNTqTw8uZ7VOeGUO/WF2xd5uIdswqlf0k f/i5hphhPN3g5wspFcQ1ycq/Zwy0a46/PtCGWxIDDH0Hs7qwBExIpgLrZzQZ2D2K5Qyd zR+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=VF1qPcvAwHbXQBYWXvhUPl/a7hV6d9jJJTRxOzM1x3s=; b=KJ5CECU/6chFhQuui5/0KO9Gve5+jYSSuyIXzn/+hovHxdQ7dK35ItUDzZ2xBo3zBT ofIg2FyeawscLZtRgp5fDlOZ2peOTPq3S63rMlmCTjuB/1sfi83Oo511nsfHLOWO3N43 4ustTbqXsfS5ulv4uYqm4E341tL8aUuBmML4AMxfFvLB7kLoiPvClutPRIL71F5Q+z7T vFn9efiYleQllJzEJDphH9cRGrJqTS8BU7VCrqCqE650h06frUG+Uvr9Hm7SzPpxwlG9 bmPJ2ZUyJLUcfzcqu3yGVBh6KsXJAcJ6PXJeWsKj1lswN/8hC2f6MLReuDGhB3XVDRnf nzcA== 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 w23si11539110edv.71.2020.06.16.17.08.59; Tue, 16 Jun 2020 17:09:22 -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 S1726505AbgFQAG6 (ORCPT + 99 others); Tue, 16 Jun 2020 20:06:58 -0400 Received: from mga02.intel.com ([134.134.136.20]:4548 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725894AbgFQAG5 (ORCPT ); Tue, 16 Jun 2020 20:06:57 -0400 IronPort-SDR: U9wWw2LOWBlZj0mcDVKcy5ibGydKyOXYqRyexVqz0P+mJ2xHNJA67lptVeRU3OxQTcCdTmQ1Vn FEm1yZBAuDUg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2020 17:06:55 -0700 IronPort-SDR: H6QpQy7n5myIs++qIDkFsI1D6malujRVIssFYyjopJQ6ePl01TEZOqIkBjKbNy+hJ3Pkff25wn WxsBx2EmKWIg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,520,1583222400"; d="scan'208";a="351907808" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.152]) by orsmga001.jf.intel.com with ESMTP; 16 Jun 2020 17:06:55 -0700 Date: Tue, 16 Jun 2020 17:06:55 -0700 From: Sean Christopherson To: Jarkko Sakkinen 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: <20200617000655.GB19300@linux.intel.com> References: <20200601075218.65618-1-jarkko.sakkinen@linux.intel.com> <20200610205903.GF18790@linux.intel.com> <20200616200958.GC10412@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200616200958.GC10412@linux.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 16, 2020 at 11:09:58PM +0300, Jarkko Sakkinen wrote: > 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? I didn't even get that complex, just running the selftest manually will eventually fail for me, e.g. the first failure I saw was a one-off run of the selftest.