From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A97C8C6379F for ; Wed, 18 Nov 2020 17:19:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 45774248AB for ; Wed, 18 Nov 2020 17:19:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alien8.de header.i=@alien8.de header.b="X0vDhShH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728299AbgKRRTI (ORCPT ); Wed, 18 Nov 2020 12:19:08 -0500 Received: from mail.skyhub.de ([5.9.137.197]:58644 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728144AbgKRRTH (ORCPT ); Wed, 18 Nov 2020 12:19:07 -0500 Received: from zn.tnic (p200300ec2f0caf000d6b904974eb4436.dip0.t-ipconnect.de [IPv6:2003:ec:2f0c:af00:d6b:9049:74eb:4436]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 2982F1EC043F; Wed, 18 Nov 2020 18:19:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1605719946; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=i0gWrz5IPeQ3BVJ7uGNVkvqrsGQF5t90eEcSwZTrGOc=; b=X0vDhShHUffzercvHvcGuHBLTDRaVJD1lNmCwIKQH7eBtm0mbaJS3Z837awbWI7Mipz3cM w2/OdnnU08vJGLjML6zWrxstTQfTRU47reTnddV4ahYixhCqMpyuIkp3v9/qBFlEd19LrF KiVoxrBo7C2cYe+vSfE+taZcs6OmWiA= Date: Wed, 18 Nov 2020 18:19:00 +0100 From: Borislav Petkov To: Jarkko Sakkinen Cc: linux-sgx@vger.kernel.org, Shuah Khan , linux-kselftest@vger.kernel.org, akpm@linux-foundation.org, andriy.shevchenko@linux.intel.com, asapek@google.com, cedric.xing@intel.com, chenalexchen@google.com, conradparker@google.com, cyhanish@google.com, dave.hansen@intel.com, haitao.huang@intel.com, 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, sean.j.christopherson@intel.com, tglx@linutronix.de, yaozhangx@google.com, mikko.ylinen@intel.com Subject: Re: [PATCH] selftests/x86: Fix malformed src_offset initialization Message-ID: <20201118171900.GJ7472@zn.tnic> References: <20201117223630.17355-1-jarkko@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20201117223630.17355-1-jarkko@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org On Wed, Nov 18, 2020 at 12:36:30AM +0200, Jarkko Sakkinen wrote: > Assign src_offset just to the p_offset, when first initialized. > This has been probably copy-pasting accident (at least looks like > it). > > Cc: Borislav Petkov > Cc: Shuah Khan > Cc: linux-kselftest@vger.kernel.org > Signed-off-by: Jarkko Sakkinen > --- > tools/testing/selftests/sgx/load.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/sgx/load.c b/tools/testing/selftests/sgx/load.c > index 07988de6b767..64976f266bae 100644 > --- a/tools/testing/selftests/sgx/load.c > +++ b/tools/testing/selftests/sgx/load.c > @@ -185,7 +185,7 @@ bool encl_load(const char *path, struct encl *encl) > } > > if (j == 0) { > - src_offset = (phdr->p_offset & PAGE_MASK) - src_offset; > + src_offset = (phdr->p_offset & PAGE_MASK); > > seg->prot = PROT_READ | PROT_WRITE; > seg->flags = SGX_PAGE_TYPE_TCS << 8; > -- Folded in after removing the brackets and pushed the whole thing out. Phew, finally! >From now on, only fixes ontop pls and testing tip:x86/sgx would be of great help. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette