Re: [PATCH] crypto: krb5enc - fix sleepable flag handling in encrypt dispatch

From: Herbert Xu

Date: Sat Mar 21 2026 - 04:42:02 EST


On Mon, Mar 09, 2026 at 12:26:24AM -0600, Wesley Atwell wrote:
> krb5enc_encrypt_ahash_done() continues encryption from an ahash
> completion callback by calling krb5enc_dispatch_encrypt().
>
> That helper takes a flags argument for this continuation path, but it
> ignored that argument and reused aead_request_flags(req) when setting
> up the skcipher subrequest callback. This can incorrectly preserve
> CRYPTO_TFM_REQ_MAY_SLEEP when the encrypt step is started from callback
> context.
>
> Preserve the original request flags but clear
> CRYPTO_TFM_REQ_MAY_SLEEP for the callback continuation path, and use
> the caller-supplied flags when setting up the skcipher subrequest.
>
> Fixes: d1775a177f7f ("crypto: Add 'krb5enc' hash and cipher AEAD algorithm")
> Assisted-by: Codex:GPT-5
> Signed-off-by: Wesley Atwell <atwellwea@xxxxxxxxx>
> ---
> crypto/krb5enc.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)

Patch applied. Thanks.
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt