lkml.org 
[lkml]   [2022]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.4 089/475] crypto: authenc - Fix sleep in atomic context in decrypt_tail
    Date
    From: Herbert Xu <herbert@gondor.apana.org.au>

    [ Upstream commit 66eae850333d639fc278d6f915c6fc01499ea893 ]

    The function crypto_authenc_decrypt_tail discards its flags
    argument and always relies on the flags from the original request
    when starting its sub-request.

    This is clearly wrong as it may cause the SLEEPABLE flag to be
    set when it shouldn't.

    Fixes: 92d95ba91772 ("crypto: authenc - Convert to new AEAD interface")
    Reported-by: Corentin Labbe <clabbe.montjoie@gmail.com>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
    Tested-by: Corentin Labbe <clabbe.montjoie@gmail.com>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    crypto/authenc.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/crypto/authenc.c b/crypto/authenc.c
    index 3f0ed9402582..321da9038995 100644
    --- a/crypto/authenc.c
    +++ b/crypto/authenc.c
    @@ -263,7 +263,7 @@ static int crypto_authenc_decrypt_tail(struct aead_request *req,
    dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, req->assoclen);

    skcipher_request_set_tfm(skreq, ctx->enc);
    - skcipher_request_set_callback(skreq, aead_request_flags(req),
    + skcipher_request_set_callback(skreq, flags,
    req->base.complete, req->base.data);
    skcipher_request_set_crypt(skreq, src, dst,
    req->cryptlen - authsize, req->iv);
    --
    2.34.1


    \
     
     \ /
      Last update: 2022-04-14 16:34    [W:4.016 / U:0.960 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site