crypto: qat - check cipher length for aead AES-CBC-HMAC-SHA
commite2c5f02307795960c595bf5a9fef4fc3b0cb858d
authorDominik Przychodni <dominik.przychodni@intel.com>
Mon, 31 Aug 2020 10:59:59 +0000 (31 11:59 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Oct 2020 08:12:58 +0000 (17 10:12 +0200)
tree43ca58f648e8d5ae7db51ad50f31cbdf91ddc311
parentfc86d27bdb53384b97f317272efdff70efb0c839
crypto: qat - check cipher length for aead AES-CBC-HMAC-SHA

commit 45cb6653b0c355fc1445a8069ba78a4ce8720511 upstream.

Return -EINVAL for authenc(hmac(sha1),cbc(aes)),
authenc(hmac(sha256),cbc(aes)) and authenc(hmac(sha512),cbc(aes))
if the cipher length is not multiple of the AES block.
This is to prevent an undefined device behaviour.

Fixes: d370cec32194 ("crypto: qat - Intel(R) QAT crypto interface")
Cc: <stable@vger.kernel.org>
Signed-off-by: Dominik Przychodni <dominik.przychodni@intel.com>
[giovanni.cabiddu@intel.com: reworded commit message]
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/crypto/qat/qat_common/qat_algs.c