diff options
author | Christian Borntraeger <borntraeger@de.ibm.com> | 2016-08-03 17:55:00 +0200 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2016-08-08 15:41:31 +0200 |
commit | 134a24cd895c5d138d639a0741ad27e389cd4562 (patch) | |
tree | c832c8b62e5b75a67a3fe840f0b174657e8ce977 /fs/nilfs2/page.c | |
parent | bf47dc572aaf53c3f2311c71e03ec01be3131fd6 (diff) | |
download | linux-134a24cd895c5d138d639a0741ad27e389cd4562.tar.bz2 |
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: f848dbd3bc1a ("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>
Diffstat (limited to 'fs/nilfs2/page.c')
0 files changed, 0 insertions, 0 deletions