2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-28 07:04:00 +08:00
linux-next/drivers/crypto/qce
Ard Biesheuvel 90e2f78271 crypto: qce - permit asynchronous skcipher as fallback
Even though the qce driver implements asynchronous versions of ecb(aes),
cbc(aes)and xts(aes), the fallbacks it allocates are required to be
synchronous. Given that SIMD based software implementations are usually
asynchronous as well, even though they rarely complete asynchronously
(this typically only happens in cases where the request was made from
softirq context, while SIMD was already in use in the task context that
it interrupted), these implementations are disregarded, and either the
generic C version or another table based version implemented in assembler
is selected instead.

Since falling back to synchronous AES is not only a performance issue, but
potentially a security issue as well (due to the fact that table based AES
is not time invariant), let's fix this, by allocating an ordinary skcipher
as the fallback, and invoke it with the completion routine that was given
to the outer request.

While at it, remove the pointless memset() from qce_skcipher_init(), and
remove the call to it qce_skcipher_init_fallback().

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2020-07-16 21:49:03 +10:00
..
cipher.h crypto: qce - permit asynchronous skcipher as fallback 2020-07-16 21:49:03 +10:00
common.c crypto: qce - handle AES-XTS cases that qce fails 2020-02-13 17:05:27 +08:00
common.h crypto: qce - support zero length test vectors 2020-07-03 14:18:34 +10:00
core.c crypto: qce - allow building only hashes/ciphers 2019-12-27 18:18:04 +08:00
core.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 284 2019-06-05 17:36:37 +02:00
dma.c crypto: qce - use cryptlen when adding extra sgl 2020-02-13 17:05:26 +08:00
dma.h crypto: qce - use cryptlen when adding extra sgl 2020-02-13 17:05:26 +08:00
Makefile crypto: qce - allow building only hashes/ciphers 2019-12-27 18:18:04 +08:00
regs-v5.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 284 2019-06-05 17:36:37 +02:00
sha.c crypto: qce/sha - Do not modify scatterlist passed along with request 2020-07-03 14:18:34 +10:00
sha.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 284 2019-06-05 17:36:37 +02:00
skcipher.c crypto: qce - permit asynchronous skcipher as fallback 2020-07-16 21:49:03 +10:00