Skip to content

Commit 5ae6887

Browse files
Linus Walleijgregkh
authored andcommitted
crypto: ux500 - memmove the right size
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 <joakim.bech@linaro.org> Reported-by: David Binderman <linuxdev.baldrick@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f6d06f1 commit 5ae6887

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/crypto/ux500/hash/hash_core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ static int hash_process_data(struct hash_device_data *device_data,
797797
&device_data->state);
798798
memmove(req_ctx->state.buffer,
799799
device_data->state.buffer,
800-
HASH_BLOCK_SIZE / sizeof(u32));
800+
HASH_BLOCK_SIZE);
801801
if (ret) {
802802
dev_err(device_data->dev,
803803
"%s: hash_resume_state() failed!\n",
@@ -848,7 +848,7 @@ static int hash_process_data(struct hash_device_data *device_data,
848848

849849
memmove(device_data->state.buffer,
850850
req_ctx->state.buffer,
851-
HASH_BLOCK_SIZE / sizeof(u32));
851+
HASH_BLOCK_SIZE);
852852
if (ret) {
853853
dev_err(device_data->dev, "%s: hash_save_state() failed!\n",
854854
__func__);

0 commit comments

Comments
 (0)