]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
crypto: ahash - fix another early termination in hash walk
authorEric Biggers <ebiggers@google.com>
Fri, 1 Feb 2019 07:51:41 +0000 (23:51 -0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commite793b1aff60bbc65a9fd7eaaa226bc7606088dca
treef30f96fc089245c82ba3fe1945ca07d0d3fd4762
parentf4886508dcad3e30df71475920c13be82952b223
crypto: ahash - fix another early termination in hash walk

BugLink: https://bugs.launchpad.net/bugs/1837952
commit 77568e535af7c4f97eaef1e555bf0af83772456c upstream.

Hash algorithms with an alignmask set, e.g. "xcbc(aes-aesni)" and
"michael_mic", fail the improved hash tests because they sometimes
produce the wrong digest.  The bug is that in the case where a
scatterlist element crosses pages, not all the data is actually hashed
because the scatterlist walk terminates too early.  This happens because
the 'nbytes' variable in crypto_hash_walk_done() is assigned the number
of bytes remaining in the page, then later interpreted as the number of
bytes remaining in the scatterlist element.  Fix it.

Fixes: 900a081f6912 ("crypto: ahash - Fix early termination in hash walk")
Cc: stable@vger.kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
crypto/ahash.c