Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: crypto: libtomcrypt: fix LTC_CLEAN_STACK bug #3102

Merged
merged 1 commit into from
Jul 1, 2019

Commits on Jul 1, 2019

  1. 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,
    because it consumes stack space in 32-byte chunks and assumes only buf
    is pushed onto the stack while ignoring any other data such as lr, fp,
    etc.. 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]>
    Acked-by: Jerome Forissier <[email protected]>
    b49020 committed Jul 1, 2019
    Configuration menu
    Copy the full SHA
    ee4be4e View commit details
    Browse the repository at this point in the history