Re: [PATCH] crypto: algif_aead - stop recvmsg looping after a completed request
From: Herbert Xu
Date: Mon Jul 13 2026 - 19:11:54 EST
On Mon, Jul 13, 2026 at 06:02:42PM +0200, cyper@xxxxxxxxxxxx wrote:
>
> A new sendmsg *does* get out of that particular wait: it sets
> ctx->init = true and af_alg_data_wakeup() wakes the sleeper, so
> af_alg_wait_for_data() returns and _aead_recvmsg() processes the new
> request. What it does *not* do is make the recvmsg() return: the
> "while (msg_data_left(msg))" loop only stops once the output buffer is
> full, so after processing the new request it just loops back and blocks
> again in af_alg_wait_for_data() for the *next* one.
That's the intended behaviour. The recvmsg(2) call on af_alg
will not return until the buffer is filled in full. This behaviour
goes back to day one (commit 8ff590903d5fc7f5a0a988c38267a3d08e6393a2)
and changing it now could break users.
Cheers,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt