Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: e845520 ("crypto: aesni - Update aesni-intel_glue to use scatter/gather") Cc: <[email protected]> # v4.17+ Cc: Dave Watson <[email protected]> Signed-off-by: Eric Biggers <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
- Loading branch information