From patchwork Tue Jul 12 09:41:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 71798 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp379350qga; Tue, 12 Jul 2016 02:48:42 -0700 (PDT) X-Received: by 10.67.3.164 with SMTP id bx4mr2279579pad.9.1468316517782; Tue, 12 Jul 2016 02:41:57 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id kb6si3200238pab.202.2016.07.12.02.41.56; Tue, 12 Jul 2016 02:41:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932505AbcGLJlx (ORCPT + 3 others); Tue, 12 Jul 2016 05:41:53 -0400 Received: from mx2.suse.de ([195.135.220.15]:55605 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932213AbcGLJlq (ORCPT ); Tue, 12 Jul 2016 05:41:46 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C4EFEAD7A; Tue, 12 Jul 2016 09:41:44 +0000 (UTC) From: Jiri Slaby To: stable@vger.kernel.org Cc: Linus Walleij , Joakim Bech , Herbert Xu , Jiri Slaby Subject: [patch added to 3.12-stable] crypto: ux500 - memmove the right size Date: Tue, 12 Jul 2016 11:41:06 +0200 Message-Id: <20160712094129.25202-29-jslaby@suse.cz> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160712094129.25202-1-jslaby@suse.cz> References: <20160712094129.25202-1-jslaby@suse.cz> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Linus Walleij This patch has been added to the 3.12 stable tree. If you have any objections, please let us know. -- 2.9.0 -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html =============== commit 19ced623db2fe91604d69f7d86b03144c5107739 upstream. The hash buffer is really HASH_BLOCK_SIZE bytes, someone must have thought that memmove takes n*u32 words by mistake. Tests work as good/bad as before after this patch. Cc: Joakim Bech Reported-by: David Binderman Signed-off-by: Linus Walleij Signed-off-by: Herbert Xu Signed-off-by: Jiri Slaby --- drivers/crypto/ux500/hash/hash_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/ux500/hash/hash_core.c b/drivers/crypto/ux500/hash/hash_core.c index 8e5e0187506f..3ff21c3e9ab2 100644 --- a/drivers/crypto/ux500/hash/hash_core.c +++ b/drivers/crypto/ux500/hash/hash_core.c @@ -797,7 +797,7 @@ static int hash_process_data(struct hash_device_data *device_data, &device_data->state); memmove(req_ctx->state.buffer, device_data->state.buffer, - HASH_BLOCK_SIZE / sizeof(u32)); + HASH_BLOCK_SIZE); if (ret) { dev_err(device_data->dev, "%s: hash_resume_state() failed!\n", @@ -848,7 +848,7 @@ static int hash_process_data(struct hash_device_data *device_data, memmove(device_data->state.buffer, req_ctx->state.buffer, - HASH_BLOCK_SIZE / sizeof(u32)); + HASH_BLOCK_SIZE); if (ret) { dev_err(device_data->dev, "%s: hash_save_state() failed!\n", __func__);