]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: testmgr - dynamically allocate crypto_shash
authorArnd Bergmann <arnd@arndb.de>
Tue, 18 Jun 2019 09:21:53 +0000 (11:21 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 27 Jun 2019 06:28:01 +0000 (14:28 +0800)
commitceb89ce9f1c9c549deaf9f6a54fdbefd33df686e
treed079cb9928b3ed09a39ede7a516196897a8dfc7e
parent254e0ccceb39ecf8ba0e94a480df1ccd75afaeb1
crypto: testmgr - dynamically allocate crypto_shash

The largest stack object in this file is now the shash descriptor.
Since there are many other stack variables, this can push it
over the 1024 byte warning limit, in particular with clang and
KASAN:

crypto/testmgr.c:1693:12: error: stack frame size of 1312 bytes in function '__alg_test_hash' [-Werror,-Wframe-larger-than=]

Make test_hash_vs_generic_impl() do the same thing as the
corresponding eaed and skcipher functions by allocating the
descriptor dynamically. We can still do better than this,
but it brings us well below the 1024 byte limit.

Suggested-by: Eric Biggers <ebiggers@kernel.org>
Fixes: 05b60ef8d35e ("crypto: testmgr - fuzz hashes against their generic implementation")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/testmgr.c