]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
crypto: lib/aesgcm - Reduce stack usage in libaesgcm_init
authorHerbert Xu <herbert@gondor.apana.org.au>
Sat, 21 Dec 2024 14:52:27 +0000 (22:52 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 28 Dec 2024 11:49:22 +0000 (19:49 +0800)
The stack frame in libaesgcm_init triggers a size warning on x86-64.
Reduce it by making buf static.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
lib/crypto/aesgcm.c

index 6bba6473fdf3474b53582fa827c32cf560b7ed7b..902e49410aaf75c9b8f1486bc1c651a556449e5b 100644 (file)
@@ -697,7 +697,7 @@ static int __init libaesgcm_init(void)
                u8 tagbuf[AES_BLOCK_SIZE];
                int plen = aesgcm_tv[i].plen;
                struct aesgcm_ctx ctx;
-               u8 buf[sizeof(ptext12)];
+               static u8 buf[sizeof(ptext12)];
 
                if (aesgcm_expandkey(&ctx, aesgcm_tv[i].key, aesgcm_tv[i].klen,
                                     aesgcm_tv[i].clen - plen)) {