linux/drivers/crypto/qce
Eneas U de Queiroz 3ee50c896d crypto: qce - save a sg table slot for result buf
When ctr-aes-qce is used for gcm-mode, an extra sg entry for the
authentication tag is present, causing trouble when the qce driver
prepares the dst-results sg table for dma.

It computes the number of entries needed with sg_nents_for_len, leaving
out the tag entry.  Then it creates a sg table with that number plus
one, used to store a result buffer.

When copying the sg table, there's no limit to the number of entries
copied, so the extra slot is filled with the authentication tag sg.
When the driver tries to add the result sg, the list is full, and it
returns EINVAL.

By limiting the number of sg entries copied to the dest table, the slot
for the result buffer is guaranteed to be unused.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2019-12-27 18:18:04 +08:00
..
cipher.h crypto: qce - switch to skcipher API 2019-11-17 09:02:48 +08:00
common.c crypto: qce - switch to skcipher API 2019-11-17 09:02:48 +08:00
common.h crypto: qce - switch to skcipher API 2019-11-17 09:02:48 +08:00
core.c crypto: qce - switch to skcipher API 2019-11-17 09:02:48 +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 - save a sg table slot for result buf 2019-12-27 18:18:04 +08:00
dma.h crypto: qce - save a sg table slot for result buf 2019-12-27 18:18:04 +08:00
Makefile crypto: qce - switch to skcipher API 2019-11-17 09:02:48 +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 - add CRYPTO_ALG_KERN_DRIVER_ONLY flag 2019-10-05 01:06:20 +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 - save a sg table slot for result buf 2019-12-27 18:18:04 +08:00