]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: arm64/aes-gcm-ce - fix scatterwalk API violation
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 20 Aug 2018 14:58:34 +0000 (16:58 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 25 Aug 2018 11:50:43 +0000 (19:50 +0800)
commitc5f10e864ad5d32168826130e0c6eac656aca796
tree5b9d46b3140e66a980f70735f3787c669ffcaedf
parent21655d232205c4b2a6409f913946a33b497bdc76
crypto: arm64/aes-gcm-ce - fix scatterwalk API violation

Commit a5dfd9126506 ("crypto: arm64/aes-ce-gcm - operate on
two input blocks at a time") modified the granularity at which
the AES/GCM code processes its input to allow subsequent changes
to be applied that improve performance by using aggregation to
process multiple input blocks at once.

For this reason, it doubled the algorithm's 'chunksize' property
to 2 x AES_BLOCK_SIZE, but retained the non-SIMD fallback path that
processes a single block at a time. In some cases, this violates the
skcipher scatterwalk API, by calling skcipher_walk_done() with a
non-zero residue value for a chunk that is expected to be handled
in its entirety. This results in a WARN_ON() to be hit by the TLS
self test code, but is likely to break other user cases as well.
Unfortunately, none of the current test cases exercises this exact
code path at the moment.

Fixes: a5dfd9126506 ("crypto: arm64/aes-ce-gcm - operate on two ...")
Reported-by: Vakul Garg <vakul.garg@nxp.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Vakul Garg <vakul.garg@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/arm64/crypto/ghash-ce-glue.c