linux-sg2042/arch/s390/crypto
Christian Borntraeger 134a24cd89 s390/crc32-vx: Fix checksum calculation for small sizes
The current prealign logic will fail for sizes < alignment,
as the new datalen passed to the vector function is smaller
than zero. Being a size_t this gets wrapped to a huge
number causing memory overruns and wrong data.

Let's add an early exit if the size is smaller than the minimal
size with alignment. This will also avoid calling the software
fallback twice for all sizes smaller than the minimum size
(prealign + remaining)

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Fixes: f848dbd3bc ("s390/crc32-vx: add crypto API module for optimized CRC-32 algorithms")
Reviewed-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2016-08-08 15:41:31 +02:00
..
Makefile s390/crc32-vx: add crypto API module for optimized CRC-32 algorithms 2016-06-15 16:36:34 +02:00
aes_s390.c crypto: s390/aes - Use skcipher for fallback 2016-07-01 23:45:10 +08:00
crc32-vx.c s390/crc32-vx: Fix checksum calculation for small sizes 2016-08-08 15:41:31 +02:00
crc32be-vx.S s390/crc32-vx: use vector instructions to optimize CRC-32 computation 2016-06-14 16:54:16 +02:00
crc32le-vx.S s390/crc32-vx: use vector instructions to optimize CRC-32 computation 2016-06-14 16:54:16 +02:00
des_s390.c s390/crypto: cleanup and move the header with the cpacf definitions 2016-04-15 18:16:40 +02:00
ghash_s390.c s390/crypto: cleanup and move the header with the cpacf definitions 2016-04-15 18:16:40 +02:00
prng.c s390/crypto: cleanup and move the header with the cpacf definitions 2016-04-15 18:16:40 +02:00
sha.h crypto: s390/sha - replace raw value by their coresponding define 2015-10-15 21:05:11 +08:00
sha1_s390.c s390/crypto: cleanup and move the header with the cpacf definitions 2016-04-15 18:16:40 +02:00
sha256_s390.c s390/crypto: cleanup and move the header with the cpacf definitions 2016-04-15 18:16:40 +02:00
sha512_s390.c s390/crypto: cleanup and move the header with the cpacf definitions 2016-04-15 18:16:40 +02:00
sha_common.c s390/crypto: cleanup and move the header with the cpacf definitions 2016-04-15 18:16:40 +02:00