From patchwork Wed Jun 8 12:56:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 69635 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp2478177qgf; Wed, 8 Jun 2016 05:57:02 -0700 (PDT) X-Received: by 10.66.248.169 with SMTP id yn9mr5613559pac.13.1465390622017; Wed, 08 Jun 2016 05:57:02 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z72si1285673pff.218.2016.06.08.05.57.01 for ; Wed, 08 Jun 2016 05:57:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161798AbcFHM5B (ORCPT ); Wed, 8 Jun 2016 08:57:01 -0400 Received: from mail-lf0-f45.google.com ([209.85.215.45]:35142 "EHLO mail-lf0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161222AbcFHM5A (ORCPT ); Wed, 8 Jun 2016 08:57:00 -0400 Received: by mail-lf0-f45.google.com with SMTP id u74so5172181lff.2 for ; Wed, 08 Jun 2016 05:56:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=nbGsmOFFgCUPPZKsSlEB0enfQFHJ6jHiLa16y3wqtF0=; b=DTaprFEDaSRpFNpHG+tK6e5tvWhUNWn4UkwMaN4DAnC0qPUPcTHQOZjzRQ0Y2iW66E JM8zz7qDoig98J4XkorwoJMqvFAqFjXtA8kbRtV0Y8I/S9MjDU1py5yMOqskGJr0uF2k f3uuMPEj6mgtdbAgcfPwnQh36ejO/d1PQRlUc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=nbGsmOFFgCUPPZKsSlEB0enfQFHJ6jHiLa16y3wqtF0=; b=fvi1QJiRWkAGxWTRI1KMPKNU9vZaXtBxaoYSicBF8gD4LK5sC1ohf0A3+1FCgH+xhd JRLCp8a/qhKUPP2qLxzQZEgH1UipX0+zOg6CLRx0fzJaVgqbvUgMdI8DvQaYJNcJ8xpl mzARNVOkcx902IstX9TSz07ocXmB7G4g3zf8NS1RUe7KffO804pe+BBY6B9bEn0bv0X7 eU/LG2m1D1ExGI5NXMvU+reDGEC5ldWSjm5SFN5LNycyhtsAmX5TvKeoUWInP1jDadlI 7xQ+5XfAEiH1AHGRinu8teGqT2SybxPZQi6BzqidcGwCVsbC+mV++sjFTI5ETEw2mHSs TbIw== X-Gm-Message-State: ALyK8tLhh0pdujvAysYpMZcPpL0IYhRw4OnH/iuxMJz/3bR2yxwCk2TxiN+MoKBMHWYSEU0G X-Received: by 10.25.85.144 with SMTP id j138mr4784860lfb.37.1465390618745; Wed, 08 Jun 2016 05:56:58 -0700 (PDT) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id h95sm135543lji.34.2016.06.08.05.56.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Jun 2016 05:56:57 -0700 (PDT) From: Linus Walleij To: linux-crypto@vger.kernel.org, Herbert Xu Cc: David Binderman , Linus Walleij , Joakim Bech Subject: [PATCH] crypto: ux500: memmove the right size Date: Wed, 8 Jun 2016 14:56:39 +0200 Message-Id: <1465390599-20605-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.11 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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 --- drivers/crypto/ux500/hash/hash_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.4.11 -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/crypto/ux500/hash/hash_core.c b/drivers/crypto/ux500/hash/hash_core.c index 574e87c7f2b8..9acccad26928 100644 --- a/drivers/crypto/ux500/hash/hash_core.c +++ b/drivers/crypto/ux500/hash/hash_core.c @@ -781,7 +781,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", @@ -832,7 +832,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__);