2019-06-28 11:27:40

by Lionel Debieve

[permalink] [raw]
Subject: [PATCH 0/2] crypto: stm32/hash: Fix bug in hmac mode

This series fixes issues discovered while using libkcapi library. Some
more tests show wrong key management in hmac mode. It is fixes by these
patches and prevent a potential issue in case of interrupt while processing
in dma mode.

Lionel Debieve (2):
crypto: stm32/hash: Fix hmac issue more than 256 bytes
crypto: stm32/hash: remove interruptible condition for dma

drivers/crypto/stm32/stm32-hash.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

--
2.17.1


2019-06-28 11:27:50

by Lionel Debieve

[permalink] [raw]
Subject: [PATCH 2/2] crypto: stm32/hash: remove interruptible condition for dma

When DMA is used, waiting for completion must not be
interruptible as it can generate an error that is not handle
by the driver. There is no need to put the completion
interruptible in this driver.

Signed-off-by: Lionel Debieve <[email protected]>
---
drivers/crypto/stm32/stm32-hash.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/stm32/stm32-hash.c b/drivers/crypto/stm32/stm32-hash.c
index c37d1a336f98..23061f2bc74b 100644
--- a/drivers/crypto/stm32/stm32-hash.c
+++ b/drivers/crypto/stm32/stm32-hash.c
@@ -447,8 +447,8 @@ static int stm32_hash_xmit_dma(struct stm32_hash_dev *hdev,

dma_async_issue_pending(hdev->dma_lch);

- if (!wait_for_completion_interruptible_timeout(&hdev->dma_completion,
- msecs_to_jiffies(100)))
+ if (!wait_for_completion_timeout(&hdev->dma_completion,
+ msecs_to_jiffies(100)))
err = -ETIMEDOUT;

if (dma_async_is_tx_complete(hdev->dma_lch, cookie,
--
2.17.1

2019-07-03 14:31:28

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH 0/2] crypto: stm32/hash: Fix bug in hmac mode

On Fri, Jun 28, 2019 at 01:26:53PM +0200, Lionel Debieve wrote:
> This series fixes issues discovered while using libkcapi library. Some
> more tests show wrong key management in hmac mode. It is fixes by these
> patches and prevent a potential issue in case of interrupt while processing
> in dma mode.
>
> Lionel Debieve (2):
> crypto: stm32/hash: Fix hmac issue more than 256 bytes
> crypto: stm32/hash: remove interruptible condition for dma
>
> drivers/crypto/stm32/stm32-hash.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)

All applied. Thanks.
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt