diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2009-05-06 14:15:47 +0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2009-06-02 14:04:45 +1000 |
commit | d89cc22372e493e0054fc843a1bb29929d18a326 (patch) | |
tree | fbd407d22d9a67a94d4149fc4b5a0f3802c71168 /crypto/internal.h | |
parent | d06feccc68bda8917cc8a96d4aca0f464bfa3670 (diff) | |
download | linux-crypto-d89cc22372e493e0054fc843a1bb29929d18a326.tar.gz linux-crypto-d89cc22372e493e0054fc843a1bb29929d18a326.zip |
crypto: testmgr - Dynamically allocate xbuf and axbuf
We currently allocate temporary memory that is used for testing
statically. This renders the testing engine non-reentrant. As
algorithms may nest, i.e., one may construct another in order to
carry out a part of its operation, this is unacceptable. For
example, it has been reported that an AEAD implementation allocates
a cipher in its setkey function, which causes it to fail during
testing as the temporary memory is overwritten.
This patch replaces the static memory with dynamically allocated
buffers. We need a maximum of 16 pages so this slightly increases
the chances of an algorithm failing due to memory shortage.
However, as testing usually occurs at registration, this shouldn't
be a big problem.
Reported-by: Shasi Pulijala <spulijala@amcc.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/internal.h')
-rw-r--r-- | crypto/internal.h | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/crypto/internal.h b/crypto/internal.h index fc76e1f3..113579a8 100644 --- a/crypto/internal.h +++ b/crypto/internal.h @@ -121,9 +121,6 @@ int crypto_register_notifier(struct notifier_block *nb); int crypto_unregister_notifier(struct notifier_block *nb); int crypto_probing_notify(unsigned long val, void *v); -int __init testmgr_init(void); -void testmgr_exit(void); - static inline void crypto_alg_put(struct crypto_alg *alg) { if (atomic_dec_and_test(&alg->cra_refcnt) && alg->cra_destroy) |