• Huang Ying's avatar
    dm crypt: fix kcryptd_async_done parameter · b2174eeb
    Huang Ying authored
    In the async encryption-complete function (kcryptd_async_done), the
    crypto_async_request passed in may be different from the one passed to
    crypto_ablkcipher_encrypt/decrypt.  Only crypto_async_request->data is
    guaranteed to be same as the one passed in.  The current
    kcryptd_async_done uses the passed-in crypto_async_request directly
    which may cause the AES-NI-based AES algorithm implementation to panic.
    
    This patch fixes this bug by only using crypto_async_request->data,
    which points to dm_crypt_request, the crypto_async_request passed in.
    The original data (convert_context) is gotten from dm_crypt_request.
    
    [mbroz@redhat.com: reworked]
    Cc: stable@kernel.org
    Signed-off-by: default avatarHuang Ying <ying.huang@intel.com>
    Cc: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: default avatarMilan Broz <mbroz@redhat.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
    b2174eeb
dm-crypt.c 31.1 KB