crypto: algif_aead - Only wake up when ctx->more is zero
authorHerbert Xu <herbert@gondor.apana.org.au>
Fri, 29 May 2020 14:23:49 +0000 (00:23 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Aug 2020 11:07:31 +0000 (13:07 +0200)
commite26cdc36de7b1bb0c75e9e46df2fb55c2b24e713
treed5535bf3d2c6c90b52978557e1bc9f619ac4fcbb
parent9f0a3ced6e25c125a00677845b86bed164c02434
crypto: algif_aead - Only wake up when ctx->more is zero

[ Upstream commit f3c802a1f30013f8f723b62d7fa49eb9e991da23 ]

AEAD does not support partial requests so we must not wake up
while ctx->more is set.  In order to distinguish between the
case of no data sent yet and a zero-length request, a new init
flag has been added to ctx.

SKCIPHER has also been modified to ensure that at least a block
of data is available if there is more data to come.

Fixes: 2d97591ef43d ("crypto: af_alg - consolidation of...")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
crypto/af_alg.c
crypto/algif_aead.c
crypto/algif_skcipher.c
include/crypto/if_alg.h