Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core: crypto: libtomcrypt: fix LTC_CLEAN_STACK bug
LTC_CLEAN_STACK uses burn_stack() API that uses a recursive call which leads to approx. double the size of stack cleaned than expected on ARM64. So this causes stack overflow corrupting canaries in case we perform a SHA512 hash operation which utilizes maximum stack as compared to other libtomcrypt APIs. So get rid of this recursive call via using variable length array to clean stack. Also, convert zeromem() API as a wrapper to call memzero_explicit(). Fixes: ad56511 ("core: crypto: libtomcrypt: enable LTC_CLEAN_STACK") Suggested-by: Daniel Thompson <[email protected]> Signed-off-by: Sumit Garg <[email protected]>
- Loading branch information