]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.6.4/crypto-ux500-memmove-the-right-size.patch
5.0-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.6.4 / crypto-ux500-memmove-the-right-size.patch
CommitLineData
bf1e68bf
GKH
1From 19ced623db2fe91604d69f7d86b03144c5107739 Mon Sep 17 00:00:00 2001
2From: Linus Walleij <linus.walleij@linaro.org>
3Date: Wed, 8 Jun 2016 14:56:39 +0200
4Subject: crypto: ux500 - memmove the right size
5
6From: Linus Walleij <linus.walleij@linaro.org>
7
8commit 19ced623db2fe91604d69f7d86b03144c5107739 upstream.
9
10The hash buffer is really HASH_BLOCK_SIZE bytes, someone
11must have thought that memmove takes n*u32 words by mistake.
12Tests work as good/bad as before after this patch.
13
14Cc: Joakim Bech <joakim.bech@linaro.org>
15Reported-by: David Binderman <linuxdev.baldrick@gmail.com>
16Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
17Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
18Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19
20---
21 drivers/crypto/ux500/hash/hash_core.c | 4 ++--
22 1 file changed, 2 insertions(+), 2 deletions(-)
23
24--- a/drivers/crypto/ux500/hash/hash_core.c
25+++ b/drivers/crypto/ux500/hash/hash_core.c
26@@ -781,7 +781,7 @@ static int hash_process_data(struct hash
27 &device_data->state);
28 memmove(req_ctx->state.buffer,
29 device_data->state.buffer,
30- HASH_BLOCK_SIZE / sizeof(u32));
31+ HASH_BLOCK_SIZE);
32 if (ret) {
33 dev_err(device_data->dev,
34 "%s: hash_resume_state() failed!\n",
35@@ -832,7 +832,7 @@ static int hash_process_data(struct hash
36
37 memmove(device_data->state.buffer,
38 req_ctx->state.buffer,
39- HASH_BLOCK_SIZE / sizeof(u32));
40+ HASH_BLOCK_SIZE);
41 if (ret) {
42 dev_err(device_data->dev, "%s: hash_save_state() failed!\n",
43 __func__);