linux/arch/arm64
Ard Biesheuvel 4378bfb7b3 crypto: arm64/aes-ccm - fix logical bug in AAD MAC handling
commit eaf46edf6e 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: a3fd82105b ("arm64/crypto: AES in CCM mode using ARMv8 Crypto ...")
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2019-07-09 22:03:53 +01:00
..
boot arm64: dts: Add more serial port nodes in APM X-Gene device tree 2014-06-18 12:41:55 +01:00
configs arm64: defconfig update for LTP 2014-06-18 12:40:52 +01:00
crypto crypto: arm64/aes-ccm - fix logical bug in AAD MAC handling 2019-07-09 22:03:53 +01:00
include locking/static_keys: Add a new static_key interface 2019-05-22 23:15:05 +01:00
kernel jump_label: Rename JUMP_LABEL_{EN,DIS}ABLE to JUMP_LABEL_{JMP,NOP} 2019-05-22 23:15:03 +01:00
kvm arm64: KVM: Tighten guest core register access from userspace 2018-12-16 22:09:32 +00:00
lib arm64: __clear_user: handle exceptions on strb 2014-11-27 11:21:47 +00:00
mm arm64: mm: check for upper PAGE_SHIFT bits in pfn_valid() 2018-12-16 22:08:48 +00:00
xen arm: xen: implement multicall hypercall support. 2014-04-24 13:09:46 +01:00
Kconfig arm64: errata: add module build workaround for erratum #843419 2015-10-06 11:52:29 +01:00
Kconfig.debug arm64: remove arch specific earlyprintk 2014-04-24 16:32:27 -07:00
Makefile arm64: errata: Add -mpc-relative-literal-loads to build flags 2016-02-17 10:22:40 +00:00