linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] crypto/krb5: Fix memory leak in krb5_test_one_prf()
@ 2025-07-09  7:11 Eric Biggers
  2025-07-09 10:28 ` David Howells
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Biggers @ 2025-07-09  7:11 UTC (permalink / raw)
  To: David Howells; +Cc: linux-crypto, netdev, Eric Biggers

Fix a leak reported by kmemleak:

    unreferenced object 0xffff8880093bf7a0 (size 32):
      comm "swapper/0", pid 1, jiffies 4294877529
      hex dump (first 32 bytes):
        9d 18 86 16 f6 38 52 fe 86 91 5b b8 40 b4 a8 86  .....8R...[.@...
        ff 3e 6b b0 f8 19 b4 9b 89 33 93 d3 93 85 42 95  .>k......3....B.
      backtrace (crc 8ba12f3b):
        kmemleak_alloc+0x8d/0xa0
        __kmalloc_noprof+0x3cd/0x4d0
        prep_buf+0x36/0x70
        load_buf+0x10d/0x1c0
        krb5_test_one_prf+0x1e1/0x3c0
        krb5_selftest.cold+0x7c/0x54c
        crypto_krb5_init+0xd/0x20
        do_one_initcall+0xa5/0x230
        do_initcalls+0x213/0x250
        kernel_init_freeable+0x220/0x260
        kernel_init+0x1d/0x170
        ret_from_fork+0x301/0x410
        ret_from_fork_asm+0x1a/0x30

Fixes: fc0cf10c04f4 ("crypto/krb5: Implement crypto self-testing")
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
---
 crypto/krb5/selftest.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/crypto/krb5/selftest.c b/crypto/krb5/selftest.c
index 2a81a6315a0d0..4519c572d37ef 100644
--- a/crypto/krb5/selftest.c
+++ b/crypto/krb5/selftest.c
@@ -150,10 +150,11 @@ static int krb5_test_one_prf(const struct krb5_prf_test *test)
 
 	ret = 0;
 
 out:
 	clear_buf(&result);
+	clear_buf(&prf);
 	clear_buf(&octet);
 	clear_buf(&key);
 	return ret;
 }
 

base-commit: 733923397fd95405a48f165c9b1fbc8c4b0a4681
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] crypto/krb5: Fix memory leak in krb5_test_one_prf()
  2025-07-09  7:11 [PATCH] crypto/krb5: Fix memory leak in krb5_test_one_prf() Eric Biggers
@ 2025-07-09 10:28 ` David Howells
  2025-07-18 11:00   ` Herbert Xu
  0 siblings, 1 reply; 3+ messages in thread
From: David Howells @ 2025-07-09 10:28 UTC (permalink / raw)
  To: Eric Biggers, Herbert Xu; +Cc: dhowells, linux-crypto, netdev

Hi Herbert,

Can you pick this up?

Eric Biggers <ebiggers@kernel.org> wrote:

> Fix a leak reported by kmemleak:
> 
>     unreferenced object 0xffff8880093bf7a0 (size 32):
>       comm "swapper/0", pid 1, jiffies 4294877529
>       hex dump (first 32 bytes):
>         9d 18 86 16 f6 38 52 fe 86 91 5b b8 40 b4 a8 86  .....8R...[.@...
>         ff 3e 6b b0 f8 19 b4 9b 89 33 93 d3 93 85 42 95  .>k......3....B.
>       backtrace (crc 8ba12f3b):
>         kmemleak_alloc+0x8d/0xa0
>         __kmalloc_noprof+0x3cd/0x4d0
>         prep_buf+0x36/0x70
>         load_buf+0x10d/0x1c0
>         krb5_test_one_prf+0x1e1/0x3c0
>         krb5_selftest.cold+0x7c/0x54c
>         crypto_krb5_init+0xd/0x20
>         do_one_initcall+0xa5/0x230
>         do_initcalls+0x213/0x250
>         kernel_init_freeable+0x220/0x260
>         kernel_init+0x1d/0x170
>         ret_from_fork+0x301/0x410
>         ret_from_fork_asm+0x1a/0x30
> 
> Fixes: fc0cf10c04f4 ("crypto/krb5: Implement crypto self-testing")
> Signed-off-by: Eric Biggers <ebiggers@kernel.org>

Acked-by: David Howells <dhowells@redhat.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] crypto/krb5: Fix memory leak in krb5_test_one_prf()
  2025-07-09 10:28 ` David Howells
@ 2025-07-18 11:00   ` Herbert Xu
  0 siblings, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2025-07-18 11:00 UTC (permalink / raw)
  To: David Howells; +Cc: Eric Biggers, linux-crypto, netdev

On Wed, Jul 09, 2025 at 11:28:30AM +0100, David Howells wrote:
> Hi Herbert,
> 
> Can you pick this up?
> 
> Eric Biggers <ebiggers@kernel.org> wrote:
> 
> > Fix a leak reported by kmemleak:
> > 
> >     unreferenced object 0xffff8880093bf7a0 (size 32):
> >       comm "swapper/0", pid 1, jiffies 4294877529
> >       hex dump (first 32 bytes):
> >         9d 18 86 16 f6 38 52 fe 86 91 5b b8 40 b4 a8 86  .....8R...[.@...
> >         ff 3e 6b b0 f8 19 b4 9b 89 33 93 d3 93 85 42 95  .>k......3....B.
> >       backtrace (crc 8ba12f3b):
> >         kmemleak_alloc+0x8d/0xa0
> >         __kmalloc_noprof+0x3cd/0x4d0
> >         prep_buf+0x36/0x70
> >         load_buf+0x10d/0x1c0
> >         krb5_test_one_prf+0x1e1/0x3c0
> >         krb5_selftest.cold+0x7c/0x54c
> >         crypto_krb5_init+0xd/0x20
> >         do_one_initcall+0xa5/0x230
> >         do_initcalls+0x213/0x250
> >         kernel_init_freeable+0x220/0x260
> >         kernel_init+0x1d/0x170
> >         ret_from_fork+0x301/0x410
> >         ret_from_fork_asm+0x1a/0x30
> > 
> > Fixes: fc0cf10c04f4 ("crypto/krb5: Implement crypto self-testing")
> > Signed-off-by: Eric Biggers <ebiggers@kernel.org>
> 
> Acked-by: David Howells <dhowells@redhat.com>

Patch applied.  Thanks.
-- 
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-07-18 11:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-09  7:11 [PATCH] crypto/krb5: Fix memory leak in krb5_test_one_prf() Eric Biggers
2025-07-09 10:28 ` David Howells
2025-07-18 11:00   ` Herbert Xu

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).