diff options
author | Eric Biggers <ebiggers@google.com> | 2019-02-01 08:51:40 +0100 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2019-02-08 08:30:08 +0100 |
commit | 3af349639597fea582a93604734d717e59a0e223 (patch) | |
tree | e14fbe662623df11569aa43b5a3db8b80e89b678 /crypto/ahash.c | |
parent | crypto: x86/morus - fix handling chunked inputs and MAY_SLEEP (diff) | |
download | linux-3af349639597fea582a93604734d717e59a0e223.tar.xz linux-3af349639597fea582a93604734d717e59a0e223.zip |
crypto: x86/aesni-gcm - fix crash on empty plaintext
gcmaes_crypt_by_sg() dereferences the NULL pointer returned by
scatterwalk_ffwd() when encrypting an empty plaintext and the source
scatterlist ends immediately after the associated data.
Fix it by only fast-forwarding to the src/dst data scatterlists if the
data length is nonzero.
This bug is reproduced by the "rfc4543(gcm(aes))" test vectors when run
with the new AEAD test manager.
Fixes: e845520707f8 ("crypto: aesni - Update aesni-intel_glue to use scatter/gather")
Cc: <stable@vger.kernel.org> # v4.17+
Cc: Dave Watson <davejwatson@fb.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/ahash.c')
0 files changed, 0 insertions, 0 deletions