From patchwork Mon Jun 16 10:02:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 31926 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A8E252107C for ; Mon, 16 Jun 2014 10:10:19 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id uz6sf30114987obc.8 for ; Mon, 16 Jun 2014 03:10:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id:cc :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=QMR+pBuelnag395TAbB8+kBuTYfUBU85tRweGe6U8+o=; b=lnjNHrDiM3NI59wtU/4XES+ROv9//BK3X+lJ7uhQXGj/mrvdVQI2I03RVX336pppcV gEGMvqE1D+FVS+wJunzSh4U6WH5+WDEWKoS3VgG1vILQ9yVI9A5cRIDGxDPOyUMGN6XW 89JYsV5oF5yY2otV7LkXqFgrz7E+s3XHVac1wuFFMvwW3UjgQ8H1uX3KGsGI1q9g8agN rL6jYb78Z1uBT0L9NOyxaiUopfZa908V7mMW/OWsy19q+blormMIUOGThmnwO69IC4oS uPDBH20wq80i2/3wfB0AWdK13Fig54rAr8sHVLV/CeLfvKYqTwTr6f2Oo7Vz4f25OaYk E0ow== X-Gm-Message-State: ALoCoQklVZpNAgku0bOrSD/ZBinZY+QikethKM58GQ870U/JRO30F2NjDk1o7C4eEPKarwNOzp2E X-Received: by 10.182.186.103 with SMTP id fj7mr410239obc.9.1402913419301; Mon, 16 Jun 2014 03:10:19 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.19.173 with SMTP id 42ls4373370qgh.27.gmail; Mon, 16 Jun 2014 03:10:19 -0700 (PDT) X-Received: by 10.52.29.236 with SMTP id n12mr819889vdh.38.1402913419170; Mon, 16 Jun 2014 03:10:19 -0700 (PDT) Received: from mail-ve0-f178.google.com (mail-ve0-f178.google.com [209.85.128.178]) by mx.google.com with ESMTPS id q9si98682vey.41.2014.06.16.03.10.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Jun 2014 03:10:19 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.178 as permitted sender) client-ip=209.85.128.178; Received: by mail-ve0-f178.google.com with SMTP id oy12so3831768veb.37 for ; Mon, 16 Jun 2014 03:10:19 -0700 (PDT) X-Received: by 10.58.132.41 with SMTP id or9mr15398148veb.5.1402913419081; Mon, 16 Jun 2014 03:10:19 -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.221.54.6 with SMTP id vs6csp123314vcb; Mon, 16 Jun 2014 03:10:18 -0700 (PDT) X-Received: by 10.224.55.202 with SMTP id v10mr25411512qag.10.1402913418719; Mon, 16 Jun 2014 03:10:18 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id f77si6666770qge.35.2014.06.16.03.10.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Jun 2014 03:10:18 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WwTkQ-0000uq-G4; Mon, 16 Jun 2014 10:02:42 +0000 Received: from mail-wi0-f174.google.com ([209.85.212.174]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WwTkN-0000rA-I5 for linux-arm-kernel@lists.infradead.org; Mon, 16 Jun 2014 10:02:40 +0000 Received: by mail-wi0-f174.google.com with SMTP id bs8so3730559wib.7 for ; Mon, 16 Jun 2014 03:02:16 -0700 (PDT) X-Received: by 10.180.149.240 with SMTP id ud16mr26190330wib.3.1402912936452; Mon, 16 Jun 2014 03:02:16 -0700 (PDT) Received: from ards-macbook-pro.guests.st.com (29-39.80-90.static-ip.oleane.fr. [90.80.39.29]) by mx.google.com with ESMTPSA id ge6sm6410698wic.0.2014.06.16.03.02.15 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Jun 2014 03:02:15 -0700 (PDT) From: Ard Biesheuvel To: catalin.marinas@arm.com Subject: [PATCH 1/2] arm64/crypto: fix data corruption bug in GHASH algorithm Date: Mon, 16 Jun 2014 12:02:15 +0200 Message-Id: <1402912936-9137-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140616_030239_741820_8F418CE8 X-CRM114-Status: GOOD ( 10.69 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.212.174 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.212.174 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: linux-arm-kernel@lists.infradead.org, Ard Biesheuvel X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.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.128.178 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 This fixes a bug in the GHASH algorithm resulting in the calculated hash to be incorrect if the input is presented in chunks whose size is not a multiple of 16 bytes. Signed-off-by: Ard Biesheuvel Fixes: fdd2389457b2 ("arm64/crypto: GHASH secure hash using ARMv8 Crypto Extensions") --- arch/arm64/crypto/ghash-ce-glue.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/crypto/ghash-ce-glue.c b/arch/arm64/crypto/ghash-ce-glue.c index b92baf3f68c7..ef6aa69c4e0c 100644 --- a/arch/arm64/crypto/ghash-ce-glue.c +++ b/arch/arm64/crypto/ghash-ce-glue.c @@ -72,6 +72,7 @@ static int ghash_update(struct shash_desc *desc, const u8 *src, partial ? ctx->buf : NULL); kernel_neon_end(); src += blocks * GHASH_BLOCK_SIZE; + partial = 0; } if (len) memcpy(ctx->buf + partial, src, len);