]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.14.44/crypto-inside-secure-wait-for-the-request-to-complete-if-in-the-backlog.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.14.44 / crypto-inside-secure-wait-for-the-request-to-complete-if-in-the-backlog.patch
1 From foo@baz Thu May 24 11:09:34 CEST 2018
2 From: Antoine Tenart <antoine.tenart@bootlin.com>
3 Date: Mon, 26 Feb 2018 14:45:12 +0100
4 Subject: crypto: inside-secure - wait for the request to complete if in the backlog
5
6 From: Antoine Tenart <antoine.tenart@bootlin.com>
7
8 [ Upstream commit 4dc5475ae0375ea4f9283dfd9b2ddc91b20d4c4b ]
9
10 This patch updates the safexcel_hmac_init_pad() function to also wait
11 for completion when the digest return code is -EBUSY, as it would mean
12 the request is in the backlog to be processed later.
13
14 Fixes: 1b44c5a60c13 ("crypto: inside-secure - add SafeXcel EIP197 crypto engine driver")
15 Suggested-by: Ofer Heifetz <oferh@marvell.com>
16 Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
17 Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
18 Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
19 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20 ---
21 drivers/crypto/inside-secure/safexcel_hash.c | 2 +-
22 1 file changed, 1 insertion(+), 1 deletion(-)
23
24 --- a/drivers/crypto/inside-secure/safexcel_hash.c
25 +++ b/drivers/crypto/inside-secure/safexcel_hash.c
26 @@ -819,7 +819,7 @@ static int safexcel_hmac_init_pad(struct
27 init_completion(&result.completion);
28
29 ret = crypto_ahash_digest(areq);
30 - if (ret == -EINPROGRESS) {
31 + if (ret == -EINPROGRESS || ret == -EBUSY) {
32 wait_for_completion_interruptible(&result.completion);
33 ret = result.error;
34 }