linux/arch/arm64/crypto
Mikulas Patocka f960d2093f crypto: arm64-aes - fix encryption of unaligned data
cryptsetup fails on arm64 when using kernel encryption via AF_ALG socket.
See https://bugzilla.redhat.com/show_bug.cgi?id=1122937

The bug is caused by incorrect handling of unaligned data in
arch/arm64/crypto/aes-glue.c. Cryptsetup creates a buffer that is aligned
on 8 bytes, but not on 16 bytes. It opens AF_ALG socket and uses the
socket to encrypt data in the buffer. The arm64 crypto accelerator causes
data corruption or crashes in the scatterwalk_pagedone.

This patch fixes the bug by passing the residue bytes that were not
processed as the last parameter to blkcipher_walk_done.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2014-07-28 22:01:02 +08:00
..
Kconfig arm64/crypto: AES-ECB/CBC/CTR/XTS using ARMv8 NEON and Crypto Extensions 2014-05-14 10:04:16 -07:00
Makefile arm64/crypto: AES-ECB/CBC/CTR/XTS using ARMv8 NEON and Crypto Extensions 2014-05-14 10:04:16 -07:00
aes-ce-ccm-core.S arm64/crypto: AES in CCM mode using ARMv8 Crypto Extensions 2014-05-14 10:04:15 -07:00
aes-ce-ccm-glue.c arm64/crypto: AES in CCM mode using ARMv8 Crypto Extensions 2014-05-14 10:04:15 -07:00
aes-ce-cipher.c arm64/crypto: AES using ARMv8 Crypto Extensions 2014-05-14 10:04:11 -07:00
aes-ce.S arm64/crypto: AES-ECB/CBC/CTR/XTS using ARMv8 NEON and Crypto Extensions 2014-05-14 10:04:16 -07:00
aes-glue.c crypto: arm64-aes - fix encryption of unaligned data 2014-07-28 22:01:02 +08:00
aes-modes.S arm64/crypto: AES-ECB/CBC/CTR/XTS using ARMv8 NEON and Crypto Extensions 2014-05-14 10:04:16 -07:00
aes-neon.S arm64/crypto: AES-ECB/CBC/CTR/XTS using ARMv8 NEON and Crypto Extensions 2014-05-14 10:04:16 -07:00
ghash-ce-core.S arm64/crypto: GHASH secure hash using ARMv8 Crypto Extensions 2014-05-14 10:04:07 -07:00
ghash-ce-glue.c arm64/crypto: GHASH secure hash using ARMv8 Crypto Extensions 2014-05-14 10:04:07 -07:00
sha1-ce-core.S
sha1-ce-glue.c
sha2-ce-core.S arm64/crypto: SHA-224/SHA-256 using ARMv8 Crypto Extensions 2014-05-14 10:04:01 -07:00
sha2-ce-glue.c arm64/crypto: SHA-224/SHA-256 using ARMv8 Crypto Extensions 2014-05-14 10:04:01 -07:00