From patchwork Wed May 6 13:54:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 48052 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F391720553 for ; Wed, 6 May 2015 13:55:08 +0000 (UTC) Received: by wiun10 with SMTP id n10sf5956492wiu.1 for ; Wed, 06 May 2015 06:55:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=FHhTlgoPA8RqJBEDbbN3/uZCV/eUFMJ0hhPs1uS3o1E=; b=Y3T1mCpFrh4TNOMMwtMckM1uSeWQVxo2lfXutrgzhgNHILchoAkzuKqzHymL3MgRXl qPMxFYZf+K4l9CvYtQrbOX7zZ36gMS5wqdDKlP7JZ340uFT4MEXwvt+R21xYHD+jEF5Z DmS2Frjj3+7FfDsmaZ7yDHR+MngOod44NdiTzrlR5An3Mcja5YvTY+CDjmSyICnMUsm7 SshlwpT1scIwnf2EXAf7elGMwNjHwALO0OuD+3pG5RWkBBkRxcq1fSqsrUih5xjexqgr xtiUmwFvGx/Fobu8aDn89/qRUTmkWxlrTrb/nwTVaf99FWPLpMiSt5cXNK8xraFgIHU4 Hojg== X-Gm-Message-State: ALoCoQlU4ZxS8wwLw92/WJ0g/zOCimiwLUrWL3qFl+0i/vefN0LtOHT5ktkp+K9WpO3RfPooxFLW X-Received: by 10.180.216.12 with SMTP id om12mr1638552wic.1.1430920508222; Wed, 06 May 2015 06:55:08 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.7.67 with SMTP id da3ls59067lad.49.gmail; Wed, 06 May 2015 06:55:08 -0700 (PDT) X-Received: by 10.112.190.10 with SMTP id gm10mr18360234lbc.2.1430920508068; Wed, 06 May 2015 06:55:08 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id q8si14775814lal.71.2015.05.06.06.55.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 May 2015 06:55:08 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by lbbuc2 with SMTP id uc2so8108792lbb.2 for ; Wed, 06 May 2015 06:55:08 -0700 (PDT) X-Received: by 10.112.140.231 with SMTP id rj7mr27920757lbb.76.1430920507943; Wed, 06 May 2015 06:55:07 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.67.65 with SMTP id l1csp2871157lbt; Wed, 6 May 2015 06:55:07 -0700 (PDT) X-Received: by 10.68.222.167 with SMTP id qn7mr60432844pbc.136.1430920506042; Wed, 06 May 2015 06:55:06 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ep1si29103714pbb.85.2015.05.06.06.55.05 for ; Wed, 06 May 2015 06:55:06 -0700 (PDT) Received-SPF: none (google.com: linux-crypto-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752023AbbEFNzD (ORCPT ); Wed, 6 May 2015 09:55:03 -0400 Received: from mail-wi0-f173.google.com ([209.85.212.173]:37621 "EHLO mail-wi0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752098AbbEFNzD (ORCPT ); Wed, 6 May 2015 09:55:03 -0400 Received: by widdi4 with SMTP id di4so23410834wid.0 for ; Wed, 06 May 2015 06:55:02 -0700 (PDT) X-Received: by 10.194.248.132 with SMTP id ym4mr64003929wjc.74.1430920501801; Wed, 06 May 2015 06:55:01 -0700 (PDT) Received: from localhost.localdomain (cag06-7-83-153-85-71.fbx.proxad.net. [83.153.85.71]) by mx.google.com with ESMTPSA id nb9sm2306564wic.10.2015.05.06.06.55.00 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 May 2015 06:55:01 -0700 (PDT) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au Cc: linux-arm-kernel@lists.infradead.org, Ard Biesheuvel Subject: [PATCH bugfix 2/2] crypto: arm64/sha2-ce - prevent asm code finalization in final() path Date: Wed, 6 May 2015 15:54:32 +0200 Message-Id: <1430920472-20416-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1430920472-20416-1-git-send-email-ard.biesheuvel@linaro.org> References: <1430920472-20416-1-git-send-email-ard.biesheuvel@linaro.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Ensure that the asm code finalization path is not triggered when invoked via final(), since it already takes care of that itself. Signed-off-by: Ard Biesheuvel --- arch/arm64/crypto/sha2-ce-glue.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm64/crypto/sha2-ce-glue.c b/arch/arm64/crypto/sha2-ce-glue.c index 1340e44c048b..7cd587564a41 100644 --- a/arch/arm64/crypto/sha2-ce-glue.c +++ b/arch/arm64/crypto/sha2-ce-glue.c @@ -75,6 +75,9 @@ static int sha256_ce_finup(struct shash_desc *desc, const u8 *data, static int sha256_ce_final(struct shash_desc *desc, u8 *out) { + struct sha256_ce_state *sctx = shash_desc_ctx(desc); + + sctx->finalize = 0; kernel_neon_begin_partial(28); sha256_base_do_finalize(desc, (sha256_block_fn *)sha2_ce_transform); kernel_neon_end();