Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1676417 > unrolled thread

[BUGFIX] crypto: atmel: only treat EBUSY as transient if backlog

Started byGilad Ben-Yossef <gilad@benyossef.com>
First post2017-06-28 09:30 +0200
Last post2017-06-28 09:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [BUGFIX] crypto: atmel: only treat EBUSY as transient if backlog Gilad Ben-Yossef <gilad@benyossef.com> - 2017-06-28 09:30 +0200

#1676417 — [BUGFIX] crypto: atmel: only treat EBUSY as transient if backlog

FromGilad Ben-Yossef <gilad@benyossef.com>
Date2017-06-28 09:30 +0200
Subject[BUGFIX] crypto: atmel: only treat EBUSY as transient if backlog
Message-ID<tXfAd-3PH-1@gated-at.bofh.it>
The Atmel SHA driver was treating -EBUSY as indication of queueing
to backlog without checking that backlog is enabled for the request.

Fix it by checking request flags.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
---

Please note I do not have access to the hardware or know it very well,
so this patch was only compile tested.  I ran into this while working
on a crypto API change and it seemed wrong.

Please review and test if you can!

 drivers/crypto/atmel-sha.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c
index a948202..dad4e5b 100644
--- a/drivers/crypto/atmel-sha.c
+++ b/drivers/crypto/atmel-sha.c
@@ -1204,7 +1204,9 @@ static int atmel_sha_finup(struct ahash_request *req)
 	ctx->flags |= SHA_FLAGS_FINUP;
 
 	err1 = atmel_sha_update(req);
-	if (err1 == -EINPROGRESS || err1 == -EBUSY)
+	if (err1 == -EINPROGRESS ||
+	    (err1 == -EBUSY && (ahash_request_flags(req) &
+				CRYPTO_TFM_REQ_MAY_BACKLOG)))
 		return err1;
 
 	/*
-- 
2.1.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web