Re: [PATCH net-next v2] crypto: af_alg/hash: Fix recvmsg() after sendmsg(MSG_MORE)
From: Herbert Xu
Date: Tue Jun 20 2023 - 04:21:18 EST
On Tue, Jun 20, 2023 at 08:42:15AM +0100, David Howells wrote:
>
> Not so. hash_recvmsg() will call crypto_ahash_init() first because ctx->more
> is false (hence why we came down this branch in hash_sendmsg()) and the result
> was released on the previous line (which you're objecting to). If it goes to
> the "done" label, it will skip setting ctx->more to true if MSG_MORE is
> passed.
I see, yes it should work.
> However, given you want sendmsg() to do the init->digest cycle on zero length
> data, I think we should revert to the previous version of the patch that makes
> a pass of the loop even with no data.
Let's get this fixed ASAP and we can refine it later.
Acked-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Thanks,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt