crypto: af_alg - Fix regression on empty requests
authorHerbert Xu <herbert@gondor.apana.org.au>
Thu, 2 Jul 2020 03:32:21 +0000 (13:32 +1000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 9 Jul 2020 08:25:22 +0000 (18:25 +1000)
commit662bb52f50bca16a74fe92b487a14d7dccb85e1a
tree6ffd6265d927924b7bd9cb7be1e9e1cdfe21d76e
parentad6a0664c29c698bfe5c46c49f627af6f5bb172b
crypto: af_alg - Fix regression on empty requests

Some user-space programs rely on crypto requests that have no
control metadata.  This broke when a check was added to require
the presence of control metadata with the ctx->init flag.

This patch fixes the regression by setting ctx->init as long as
one sendmsg(2) has been made, with or without a control message.

Reported-by: Sachin Sant <sachinp@linux.vnet.ibm.com>
Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Fixes: f3c802a1f300 ("crypto: algif_aead - Only wake up when...")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/af_alg.c