summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-08-30 15:53:44 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2020-08-30 15:53:44 -0700
commit8e8c9f9431eed0b5a026db016ca5a70c7b404ea7 (patch)
tree53f20cac229fa1052649d4d826ce912c5a77da88
parentecba6441ac30016919d78edf077c2579ca4d4e89 (diff)
parent113767ab58ba2b4430fa802ccafd7e4c04ae512b (diff)
downloadlinux-crypto-8e8c9f9431eed0b5a026db016ca5a70c7b404ea7.tar.gz
linux-crypto-8e8c9f9431eed0b5a026db016ca5a70c7b404ea7.zip
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fixes from Herbert Xu: - fix regression in af_alg that affects iwd - restore polling delay in qat - fix double free in ingenic on error path - fix potential build failure in sa2ul due to missing Kconfig dependency * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: af_alg - Work around empty control messages without MSG_MORE crypto: sa2ul - add Kconfig selects to fix build error crypto: ingenic - Drop kfree for memory allocated with devm_kzalloc crypto: qat - add delay before polling mailbox
-rw-r--r--crypto/af_alg.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/crypto/af_alg.c b/crypto/af_alg.c
index a6f581ab..8be8bec0 100644
--- a/crypto/af_alg.c
+++ b/crypto/af_alg.c
@@ -16,6 +16,7 @@
#include <linux/module.h>
#include <linux/net.h>
#include <linux/rwsem.h>
+#include <linux/sched.h>
#include <linux/sched/signal.h>
#include <linux/security.h>
@@ -845,9 +846,15 @@ int af_alg_sendmsg(struct socket *sock, struct msghdr *msg, size_t size,
}
lock_sock(sk);
- if (ctx->init && (init || !ctx->more)) {
- err = -EINVAL;
- goto unlock;
+ if (ctx->init && !ctx->more) {
+ if (ctx->used) {
+ err = -EINVAL;
+ goto unlock;
+ }
+
+ pr_info_once(
+ "%s sent an empty control message without MSG_MORE.\n",
+ current->comm);
}
ctx->init = true;