From: Herbert Xu Date: Wed, 19 Jan 2022 06:58:40 +0000 (+1100) Subject: crypto: authenc - Fix sleep in atomic context in decrypt_tail X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=582ba2867994da3ecd1ef90d1c0b4b2170cfc0fd;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git crypto: authenc - Fix sleep in atomic context in decrypt_tail [ Upstream commit 66eae850333d639fc278d6f915c6fc01499ea893 ] The function crypto_authenc_decrypt_tail discards its flags argument and always relies on the flags from the original request when starting its sub-request. This is clearly wrong as it may cause the SLEEPABLE flag to be set when it shouldn't. Fixes: 92d95ba91772 ("crypto: authenc - Convert to new AEAD interface") Reported-by: Corentin Labbe Signed-off-by: Herbert Xu Tested-by: Corentin Labbe Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- diff --git a/crypto/authenc.c b/crypto/authenc.c index 053287dfad65..533e811a0899 100644 --- a/crypto/authenc.c +++ b/crypto/authenc.c @@ -268,7 +268,7 @@ static int crypto_authenc_decrypt_tail(struct aead_request *req, dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, req->assoclen); skcipher_request_set_tfm(skreq, ctx->enc); - skcipher_request_set_callback(skreq, aead_request_flags(req), + skcipher_request_set_callback(skreq, flags, req->base.complete, req->base.data); skcipher_request_set_crypt(skreq, src, dst, req->cryptlen - authsize, req->iv);