crypto: virtio - deal with unsupported input sizes
authorArd Biesheuvel <ardb@kernel.org>
Sat, 9 Nov 2019 17:09:27 +0000 (18:09 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 31 Dec 2019 15:45:35 +0000 (16:45 +0100)
commitf4a645928c9f60bd659cda276c37b53bd3636f1a
tree4bb75845d0d9f86ad3381b127ceb48ee480586bf
parent7d9098d4c988b33c4e7ad0b2bf57489cb4158f57
crypto: virtio - deal with unsupported input sizes

[ Upstream commit 19c5da7d4a2662e85ea67d2d81df57e038fde3ab ]

Return -EINVAL for input sizes that are not a multiple of the AES
block size, since they are not supported by our CBC chaining mode.

While at it, remove the pr_err() that reports unsupported key sizes
being used: we shouldn't spam the kernel log with that.

Fixes: dbaf0624ffa5 ("crypto: add virtio-crypto driver")
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Gonglei <arei.gonglei@huawei.com>
Cc: virtualization@lists.linux-foundation.org
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/crypto/virtio/virtio_crypto_algs.c