Re: [PATCH 2/3] crypto: inside-secure - Reduce stack usage

From: Herbert Xu
Date: Thu Oct 10 2019 - 08:41:20 EST


On Mon, Sep 30, 2019 at 02:14:34PM +0200, Arnd Bergmann wrote:
> safexcel_aead_setkey() contains three large stack variables, totalling
> slightly more than the 1024 byte warning limit:
>
> drivers/crypto/inside-secure/safexcel_cipher.c:303:12: error: stack frame size of 1032 bytes in function 'safexcel_aead_setkey' [-Werror,-Wframe-larger-than=]
>
> The function already contains a couple of dynamic allocations, so it is
> likely not performance critical and it can only be called in a context
> that allows sleeping, so the easiest workaround is to add change it
> to use dynamic allocations. Combining istate and ostate into a single
> variable simplifies the allocation at the cost of making it slightly
> less readable.
>
> Alternatively, it should be possible to shrink these allocations
> as the extra buffers appear to be largely unnecessary, but doing
> this would be a much more invasive change.
>
> Fixes: 0e17e3621a28 ("crypto: inside-secure - add support for authenc(hmac(sha*),rfc3686(ctr(aes))) suites")
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
> ---
> .../crypto/inside-secure/safexcel_cipher.c | 53 ++++++++++++-------
> 1 file changed, 35 insertions(+), 18 deletions(-)

This patch doesn't apply against the current cryptodev tree.

Please respin it.

Thanks,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt