summaryrefslogtreecommitdiff
path: root/include/crypto
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2023-11-28 16:25:49 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-01-25 14:34:23 -0800
commit4c10928e31c72fcf1f212c9ac57ae2550eccbd15 (patch)
tree87e2c87515351606e1d8055766c52da28f6153fe /include/crypto
parentca3484d5cadc39a075d3509b3f8988c9d7223b8e (diff)
downloadlinux-4c10928e31c72fcf1f212c9ac57ae2550eccbd15.tar.gz
linux-4c10928e31c72fcf1f212c9ac57ae2550eccbd15.tar.bz2
linux-4c10928e31c72fcf1f212c9ac57ae2550eccbd15.zip
crypto: af_alg - Disallow multiple in-flight AIO requests
[ Upstream commit 67b164a871af1d736f131fd6fe78a610909f06f3 ] Having multiple in-flight AIO requests results in unpredictable output because they all share the same IV. Fix this by only allowing one request at a time. Fixes: 83094e5e9e49 ("crypto: af_alg - add async support to algif_aead") Fixes: a596999b7ddf ("crypto: algif - change algif_skcipher to be asynchronous") Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/crypto')
-rw-r--r--include/crypto/if_alg.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/crypto/if_alg.h b/include/crypto/if_alg.h
index c1a8d4a41bb1..f4ff7ae0128a 100644
--- a/include/crypto/if_alg.h
+++ b/include/crypto/if_alg.h
@@ -137,6 +137,7 @@ struct af_alg_async_req {
* recvmsg is invoked.
* @init: True if metadata has been sent.
* @len: Length of memory allocated for this data structure.
+ * @inflight: Non-zero when AIO requests are in flight.
*/
struct af_alg_ctx {
struct list_head tsgl_list;
@@ -155,6 +156,8 @@ struct af_alg_ctx {
bool init;
unsigned int len;
+
+ unsigned int inflight;
};
int af_alg_register_type(const struct af_alg_type *type);