Skip to content

Commit 180ce7e

Browse files
committed
crypto: authenc - Add EINPROGRESS check
When Steffen originally wrote the authenc async hash patch, he correctly had EINPROGRESS checks in place so that we did not invoke the original completion handler with it. Unfortuantely I told him to remove it before the patch was applied. As only MAY_BACKLOG request completion handlers are required to handle EINPROGRESS completions, those checks are really needed. This patch restores them. Reported-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 7478138 commit 180ce7e

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

crypto/authenc.c

+11-5
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ struct authenc_request_ctx {
4646
char tail[];
4747
};
4848

49+
static void authenc_request_complete(struct aead_request *req, int err)
50+
{
51+
if (err != -EINPROGRESS)
52+
aead_request_complete(req, err);
53+
}
54+
4955
static int crypto_authenc_setkey(struct crypto_aead *authenc, const u8 *key,
5056
unsigned int keylen)
5157
{
@@ -142,7 +148,7 @@ static void authenc_geniv_ahash_update_done(struct crypto_async_request *areq,
142148
crypto_aead_authsize(authenc), 1);
143149

144150
out:
145-
aead_request_complete(req, err);
151+
authenc_request_complete(req, err);
146152
}
147153

148154
static void authenc_geniv_ahash_done(struct crypto_async_request *areq, int err)
@@ -208,7 +214,7 @@ static void authenc_verify_ahash_update_done(struct crypto_async_request *areq,
208214
err = crypto_ablkcipher_decrypt(abreq);
209215

210216
out:
211-
aead_request_complete(req, err);
217+
authenc_request_complete(req, err);
212218
}
213219

214220
static void authenc_verify_ahash_done(struct crypto_async_request *areq,
@@ -245,7 +251,7 @@ static void authenc_verify_ahash_done(struct crypto_async_request *areq,
245251
err = crypto_ablkcipher_decrypt(abreq);
246252

247253
out:
248-
aead_request_complete(req, err);
254+
authenc_request_complete(req, err);
249255
}
250256

251257
static u8 *crypto_authenc_ahash_fb(struct aead_request *req, unsigned int flags)
@@ -379,7 +385,7 @@ static void crypto_authenc_encrypt_done(struct crypto_async_request *req,
379385
err = crypto_authenc_genicv(areq, iv, 0);
380386
}
381387

382-
aead_request_complete(areq, err);
388+
authenc_request_complete(areq, err);
383389
}
384390

385391
static int crypto_authenc_encrypt(struct aead_request *req)
@@ -420,7 +426,7 @@ static void crypto_authenc_givencrypt_done(struct crypto_async_request *req,
420426
err = crypto_authenc_genicv(areq, greq->giv, 0);
421427
}
422428

423-
aead_request_complete(areq, err);
429+
authenc_request_complete(areq, err);
424430
}
425431

426432
static int crypto_authenc_givencrypt(struct aead_givcrypt_request *req)

0 commit comments

Comments
 (0)