]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - crypto/algif_skcipher.c
crypto: af_alg - wait for data at beginning of recvmsg
[mirror_ubuntu-bionic-kernel.git] / crypto / algif_skcipher.c
index 30cff827dd8fff048fa3e2ca7de770ab73022749..6fb595cd63ac2a9d14fd606210eeb065930e3724 100644 (file)
@@ -72,6 +72,12 @@ static int _skcipher_recvmsg(struct socket *sock, struct msghdr *msg,
        int err = 0;
        size_t len = 0;
 
+       if (!ctx->used) {
+               err = af_alg_wait_for_data(sk, flags);
+               if (err)
+                       return err;
+       }
+
        /* Allocate cipher request for current operation. */
        areq = af_alg_alloc_areq(sk, sizeof(struct af_alg_async_req) +
                                     crypto_skcipher_reqsize(tfm));