linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RESEND] SHASH_DESC_ON_STACK macro
Date: Tue, 27 Mar 2018 18:07:09 +0800	[thread overview]
Message-ID: <20180327100709.GA12961@gondor.apana.org.au> (raw)
In-Reply-To: <bda66faa-f52d-215d-f21b-763593b30f91@embeddedor.com>

On Fri, Mar 23, 2018 at 02:09:46PM -0500, Gustavo A. R. Silva wrote:
> 
> Hi Herbert,
> 
> There is an ongoing effort to remove all VLAs from the code base [1] and
> while working on that I came across the following macro at
> include/crypto/hash.h:154:
> 
> #define SHASH_DESC_ON_STACK(shash, ctx)                           \
>         char __##shash##_desc[sizeof(struct shash_desc) +         \
>                 crypto_shash_descsize(ctx)] CRYPTO_MINALIGN_ATTR; \
>         struct shash_desc *shash = (struct shash_desc *)__##shash##_desc
> 
> 
> Currently, this macro is being used in 46 different places.
> 
> I wonder how big can tfm->descsize can get?

descsize is capped at PAGE_SIZE / 8.

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

  reply	other threads:[~2018-03-27 10:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-21 15:07 [RFC] SHASH_DESC_ON_STACK macro Gustavo A. R. Silva
2018-03-23 19:09 ` [RESEND] " Gustavo A. R. Silva
2018-03-27 10:07   ` Herbert Xu [this message]
2018-04-05  8:26     ` Gustavo A. R. Silva

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180327100709.GA12961@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=davem@davemloft.net \
    --cc=gustavo@embeddedor.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).