author: Linus Torvalds <torvalds@linux-foundation.org> 2020-08-30 15:53:44 -0700
committer: Linus Torvalds <torvalds@linux-foundation.org> 2020-08-30 15:53:44 -0700
commit: e43327c706f28d9e66fc4242af4aefdd69e8ff24
parent: dcc5c6f013d841e9ae74d527d312d512dfc2e2f0
Commit Summary:
Diffstat:
1 file changed, 9 insertions, 3 deletions
diff --git a/crypto/af_alg.c b/crypto/af_alg.c
index a6f581ab200c..8be8bec07cdd 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;