]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: testmgr - fix length truncation with large page size
authorEric Biggers <ebiggers@google.com>
Mon, 20 May 2019 16:47:19 +0000 (09:47 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 30 May 2019 07:28:40 +0000 (15:28 +0800)
commitb4e0d0a2c61861dab71413f29a54171e9befb5ad
tree5197a7c1a4621ad0c41c1c1f8ca88e5eb255ad3a
parent8d15ac5a433f3fd170daddc9b5e65c85639d4fb0
crypto: testmgr - fix length truncation with large page size

On PowerPC with CONFIG_CRYPTO_MANAGER_EXTRA_TESTS=y, there is sometimes
a crash in generate_random_aead_testvec().  The problem is that the
generated test vectors use data lengths of up to about 2 * PAGE_SIZE,
which is 128 KiB on PowerPC; however, the data length fields in the test
vectors are 'unsigned short', so the lengths get truncated.  Fix this by
changing the relevant fields to 'unsigned int'.

Fixes: 61d3e426979c ("crypto: testmgr - fuzz AEADs against their generic implementation")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/testmgr.h