From patchwork Wed May 6 13:54:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 48051 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2879F20553 for ; Wed, 6 May 2015 13:55:08 +0000 (UTC) Received: by lbos2 with SMTP id s2sf3269313lbo.2 for ; Wed, 06 May 2015 06:55:07 -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:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=Jy2s61jJaY45owAjRtKXJM2Q3yaS1UP+QYnlm4DkGWM=; b=ew6/Gv6BjJyk9ECHcm3Q3M9igb+mRng89HqaMBg2YcPBdA5RsXnXfHghjcN1wLsktj HVq/LAlcjMdqCxZOkZsImyv2r7z7gtrDPc90AJYSDSGJFy5nwmFp8VagDKSKIBvBU+Tm sSlyNPq5DnJ3jMY6DzHNLYlf2D8OGYSyE2H81tshaw3pEph5xEhivCMHXB26o1QmFFSo Ep6MVNPzX1MFwk9jZckGWZUIuHsrqYiQ6oTVXhMxe9kcPtrJppMP/BoYedlSg0zCo3xZ 3LfMgn+2wd+qHyjTwhnMhbre/mFHyr1Zd09kh1xGabMIxQskMeO+3kiqZoQQLLRbWAC+ d05Q== X-Gm-Message-State: ALoCoQnVzVRid4LWdVUghFQ9uBlpfTOwNejMouYNrRjXDqqVTqXVafwTnh03xpH4a/480BMAGoW9 X-Received: by 10.194.249.1 with SMTP id yq1mr26008518wjc.2.1430920507077; Wed, 06 May 2015 06:55:07 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.204.168 with SMTP id kz8ls43263lac.105.gmail; Wed, 06 May 2015 06:55:06 -0700 (PDT) X-Received: by 10.112.17.8 with SMTP id k8mr28573060lbd.28.1430920506918; Wed, 06 May 2015 06:55:06 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id ao1si14751771lbd.172.2015.05.06.06.55.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 May 2015 06:55:06 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by lagv1 with SMTP id v1so7942517lag.3 for ; Wed, 06 May 2015 06:55:06 -0700 (PDT) X-Received: by 10.112.150.100 with SMTP id uh4mr27978193lbb.112.1430920506727; Wed, 06 May 2015 06:55:06 -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 l1csp2871148lbt; Wed, 6 May 2015 06:55:06 -0700 (PDT) X-Received: by 10.66.222.72 with SMTP id qk8mr61023286pac.7.1430920505064; Wed, 06 May 2015 06:55:05 -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.04 for ; Wed, 06 May 2015 06:55:05 -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 S1751554AbbEFNzD (ORCPT ); Wed, 6 May 2015 09:55:03 -0400 Received: from mail-wg0-f50.google.com ([74.125.82.50]:32871 "EHLO mail-wg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752018AbbEFNzB (ORCPT ); Wed, 6 May 2015 09:55:01 -0400 Received: by wgin8 with SMTP id n8so12556699wgi.0 for ; Wed, 06 May 2015 06:55:00 -0700 (PDT) X-Received: by 10.195.18.103 with SMTP id gl7mr60488584wjd.34.1430920500279; Wed, 06 May 2015 06:55:00 -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.54.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 May 2015 06:54:59 -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 1/2] crypto: arm64/sha1-ce - prevent asm code finalization in final() path Date: Wed, 6 May 2015 15:54:31 +0200 Message-Id: <1430920472-20416-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 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.215.53 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/sha1-ce-glue.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm64/crypto/sha1-ce-glue.c b/arch/arm64/crypto/sha1-ce-glue.c index 114e7cc5de8c..aefda9868627 100644 --- a/arch/arm64/crypto/sha1-ce-glue.c +++ b/arch/arm64/crypto/sha1-ce-glue.c @@ -74,6 +74,9 @@ static int sha1_ce_finup(struct shash_desc *desc, const u8 *data, static int sha1_ce_final(struct shash_desc *desc, u8 *out) { + struct sha1_ce_state *sctx = shash_desc_ctx(desc); + + sctx->finalize = 0; kernel_neon_begin_partial(16); sha1_base_do_finalize(desc, (sha1_block_fn *)sha1_ce_transform); kernel_neon_end();