summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2023-01-13 18:27:51 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-11 16:26:37 +0100
commitcc4d0d4251748a8a68026938f4055d2ac47c5719 (patch)
tree5049df773b4f5b00b47f986e2adc062b585effa2
parent8a9a8547e8af1cf28d39b04f2d1cc021e5c9dfaa (diff)
downloadlinux-stable-cc4d0d4251748a8a68026938f4055d2ac47c5719.tar.gz
linux-stable-cc4d0d4251748a8a68026938f4055d2ac47c5719.tar.bz2
linux-stable-cc4d0d4251748a8a68026938f4055d2ac47c5719.zip
crypto: seqiv - Handle EBUSY correctly
[ Upstream commit 32e62025e5e52fbe4812ef044759de7010b15dbc ] As it is seqiv only handles the special return value of EINPROGERSS, which means that in all other cases it will free data related to the request. However, as the caller of seqiv may specify MAY_BACKLOG, we also need to expect EBUSY and treat it in the same way. Otherwise backlogged requests will trigger a use-after-free. Fixes: 0a270321dbf9 ("[CRYPTO] seqiv: Add Sequence Number IV Generator") Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--crypto/seqiv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/seqiv.c b/crypto/seqiv.c
index 570b7d1aa0ca..ce9214097bc9 100644
--- a/crypto/seqiv.c
+++ b/crypto/seqiv.c
@@ -30,7 +30,7 @@ static void seqiv_aead_encrypt_complete2(struct aead_request *req, int err)
struct aead_request *subreq = aead_request_ctx(req);
struct crypto_aead *geniv;
- if (err == -EINPROGRESS)
+ if (err == -EINPROGRESS || err == -EBUSY)
return;
if (err)