Home
last modified time | relevance | path

Searched hist:bfb19bc2229a737e12e96c1e6968a6ebdd57adc5 (Results 1 – 1 of 1) sorted by relevance

/optee_os/core/lib/libtomcrypt/
H A Dmpi_desc.cbfb19bc2229a737e12e96c1e6968a6ebdd57adc5 Fri Dec 17 06:28:16 UTC 2021 Sahil Malhotra <sahil.malhotra@nxp.com> core: libtomcrypt: increase MPI_MEMPOOL_SIZE to 46kB

This value is increased because xtest pkcs11_1019 when run
in loop, leads to extensive use of memory pool which
sometimes leads to memory allocation failure.

Problem is the way mempool_alloc() is implemented in combination
with how it's used from ltc_ecc_projective_add_point().

mempool_alloc() has a stack like allocation scheme. When freeing
the top element that memory is returned to the pool, but if memory
further down is free it's not returned until all elements above has
been freed. If two or more elements gets allocated and freed in a
cycle they can continue to use more and more memory with nothing
returned.

Signed-off-by: Sahil Malhotra <sahil.malhotra@nxp.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
Fixes: https://github.com/OP-TEE/optee_os/issues/5022