Skip to content

Commit

Permalink
crypto: lib/aesgcm - Reduce stack usage in libaesgcm_init
Browse files Browse the repository at this point in the history
The stack frame in libaesgcm_init triggers a size warning on x86-64.
Reduce it by making buf static.

Signed-off-by: Herbert Xu <[email protected]>
Acked-by: Ard Biesheuvel <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
herbertx committed Dec 28, 2024
1 parent 7b6092e commit de66242
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/crypto/aesgcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit de66242

Please sign in to comment.