lkml.org 
[lkml]   [2018]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RESEND] SHASH_DESC_ON_STACK macro
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

\
 
 \ /
  Last update: 2018-03-27 12:07    [W:0.371 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site