]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
crypto: arm64/aes-ccm - fix logical bug in AAD MAC handling
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 24 Jan 2019 16:33:45 +0000 (17:33 +0100)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit72fdc29233ab4cf6c7ec1b63b3d75dedbd68e161
tree5290709cf38019387c29b5aa8789113c10d71c95
parentf3a4daebc884e4abd824ef2c89742bf2357fd342
crypto: arm64/aes-ccm - fix logical bug in AAD MAC handling

BugLink: https://bugs.launchpad.net/bugs/1837952
commit eaf46edf6ea89675bd36245369c8de5063a0272c upstream.

The NEON MAC calculation routine fails to handle the case correctly
where there is some data in the buffer, and the input fills it up
exactly. In this case, we enter the loop at the end with w8 == 0,
while a negative value is assumed, and so the loop carries on until
the increment of the 32-bit counter wraps around, which is quite
obviously wrong.

So omit the loop altogether in this case, and exit right away.

Reported-by: Eric Biggers <ebiggers@kernel.org>
Fixes: a3fd82105b9d1 ("arm64/crypto: AES in CCM mode using ARMv8 Crypto ...")
Cc: stable@vger.kernel.org
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
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>
arch/arm64/crypto/aes-ce-ccm-core.S