Skip to content
Commit f8b0d4d0 authored by Herbert Xu's avatar Herbert Xu
Browse files

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: default avatarShasi Pulijala <spulijala@amcc.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 29ecd4ab
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment