linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: "Stephan Müller" <smueller@chronox.de>
Cc: davem@davemloft.net, herbert@gondor.apana.org.au,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	syzkaller-bugs@googlegroups.com,
	syzbot <syzbot+2e635807decef724a1fa@syzkaller.appspotmail.com>
Subject: Re: memory leak in crypto_create_tfm
Date: Tue, 2 Jun 2020 20:55:41 -0700	[thread overview]
Message-ID: <20200603035541.GB50072@sol.localdomain> (raw)
In-Reply-To: <0000000000002a280b05a725cd93@google.com>

Probably a bug in crypto/drbg.c.  Stephan, can you take a look?

On Tue, Jun 02, 2020 at 08:41:21PM -0700, syzbot wrote:
> Hello,
> 
> syzbot found the following crash on:
> 
> HEAD commit:    19409891 Merge tag 'pnp-5.8-rc1' of git://git.kernel.org/p..
> git tree:       upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=13165aa6100000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=6d41e63a2c7e0715
> dashboard link: https://syzkaller.appspot.com/bug?extid=2e635807decef724a1fa
> compiler:       gcc (GCC) 9.0.0 20181231 (experimental)
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=17f00ef2100000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=170f2ef2100000
> 
> IMPORTANT: if you fix the bug, please add the following tag to the commit:
> Reported-by: syzbot+2e635807decef724a1fa@syzkaller.appspotmail.com
> 
> executing program
> executing program
> BUG: memory leak
> unreferenced object 0xffff8881175bc480 (size 64):
>   comm "syz-executor064", pid 6388, jiffies 4294941622 (age 13.280s)
>   hex dump (first 32 bytes):
>     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
>     e0 7e 56 84 ff ff ff ff 00 00 00 00 00 00 00 00  .~V.............
>   backtrace:
>     [<0000000029c7602f>] kmalloc include/linux/slab.h:560 [inline]
>     [<0000000029c7602f>] kzalloc include/linux/slab.h:669 [inline]
>     [<0000000029c7602f>] crypto_create_tfm+0x31/0x100 crypto/api.c:448
>     [<00000000bec8cbdb>] crypto_alloc_tfm+0x79/0x1a0 crypto/api.c:527
>     [<000000002f9791ba>] drbg_prepare_hrng crypto/drbg.c:1509 [inline]
>     [<000000002f9791ba>] drbg_instantiate crypto/drbg.c:1587 [inline]
>     [<000000002f9791ba>] drbg_kcapi_seed+0x432/0x6a9 crypto/drbg.c:1980
>     [<0000000041302bb8>] crypto_rng_reset+0x35/0x1a0 crypto/rng.c:53
>     [<000000004758c3c4>] alg_setkey crypto/af_alg.c:222 [inline]
>     [<000000004758c3c4>] alg_setsockopt+0x149/0x190 crypto/af_alg.c:255
>     [<000000008bc4b5cb>] __sys_setsockopt+0x112/0x230 net/socket.c:2132
>     [<00000000cfbf30da>] __do_sys_setsockopt net/socket.c:2148 [inline]
>     [<00000000cfbf30da>] __se_sys_setsockopt net/socket.c:2145 [inline]
>     [<00000000cfbf30da>] __x64_sys_setsockopt+0x22/0x30 net/socket.c:2145
>     [<00000000fc9c2183>] do_syscall_64+0x6e/0x220 arch/x86/entry/common.c:295
>     [<0000000040e080a1>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
> 
> BUG: memory leak
> unreferenced object 0xffff8881175bc040 (size 64):
>   comm "syz-executor064", pid 6389, jiffies 4294942172 (age 7.780s)
>   hex dump (first 32 bytes):
>     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
>     e0 7e 56 84 ff ff ff ff 00 00 00 00 00 00 00 00  .~V.............
>   backtrace:
>     [<0000000029c7602f>] kmalloc include/linux/slab.h:560 [inline]
>     [<0000000029c7602f>] kzalloc include/linux/slab.h:669 [inline]
>     [<0000000029c7602f>] crypto_create_tfm+0x31/0x100 crypto/api.c:448
>     [<00000000bec8cbdb>] crypto_alloc_tfm+0x79/0x1a0 crypto/api.c:527
>     [<000000002f9791ba>] drbg_prepare_hrng crypto/drbg.c:1509 [inline]
>     [<000000002f9791ba>] drbg_instantiate crypto/drbg.c:1587 [inline]
>     [<000000002f9791ba>] drbg_kcapi_seed+0x432/0x6a9 crypto/drbg.c:1980
>     [<0000000041302bb8>] crypto_rng_reset+0x35/0x1a0 crypto/rng.c:53
>     [<000000004758c3c4>] alg_setkey crypto/af_alg.c:222 [inline]
>     [<000000004758c3c4>] alg_setsockopt+0x149/0x190 crypto/af_alg.c:255
>     [<000000008bc4b5cb>] __sys_setsockopt+0x112/0x230 net/socket.c:2132
>     [<00000000cfbf30da>] __do_sys_setsockopt net/socket.c:2148 [inline]
>     [<00000000cfbf30da>] __se_sys_setsockopt net/socket.c:2145 [inline]
>     [<00000000cfbf30da>] __x64_sys_setsockopt+0x22/0x30 net/socket.c:2145
>     [<00000000fc9c2183>] do_syscall_64+0x6e/0x220 arch/x86/entry/common.c:295
>     [<0000000040e080a1>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
> 
> BUG: memory leak
> unreferenced object 0xffff88811b3ca080 (size 96):
>   comm "syz-executor064", pid 6389, jiffies 4294942172 (age 7.780s)
>   hex dump (first 32 bytes):
>     89 c7 08 cb 8a 12 10 6e 00 00 00 00 00 00 00 00  .......n........
>     71 51 5a c2 1b 00 00 00 35 7d 00 00 00 00 00 00  qQZ.....5}......
>   backtrace:
>     [<000000008ec3eca0>] jent_entropy_collector_alloc+0x1b/0xf8 crypto/jitterentropy.c:662
>     [<0000000026ed401a>] jent_kcapi_init+0x17/0x40 crypto/jitterentropy-kcapi.c:119
>     [<00000000be7d6b06>] crypto_create_tfm+0x89/0x100 crypto/api.c:459
>     [<00000000bec8cbdb>] crypto_alloc_tfm+0x79/0x1a0 crypto/api.c:527
>     [<000000002f9791ba>] drbg_prepare_hrng crypto/drbg.c:1509 [inline]
>     [<000000002f9791ba>] drbg_instantiate crypto/drbg.c:1587 [inline]
>     [<000000002f9791ba>] drbg_kcapi_seed+0x432/0x6a9 crypto/drbg.c:1980
>     [<0000000041302bb8>] crypto_rng_reset+0x35/0x1a0 crypto/rng.c:53
>     [<000000004758c3c4>] alg_setkey crypto/af_alg.c:222 [inline]
>     [<000000004758c3c4>] alg_setsockopt+0x149/0x190 crypto/af_alg.c:255
>     [<000000008bc4b5cb>] __sys_setsockopt+0x112/0x230 net/socket.c:2132
>     [<00000000cfbf30da>] __do_sys_setsockopt net/socket.c:2148 [inline]
>     [<00000000cfbf30da>] __se_sys_setsockopt net/socket.c:2145 [inline]
>     [<00000000cfbf30da>] __x64_sys_setsockopt+0x22/0x30 net/socket.c:2145
>     [<00000000fc9c2183>] do_syscall_64+0x6e/0x220 arch/x86/entry/common.c:295
>     [<0000000040e080a1>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
> 
> 
> 
> ---
> This bug is generated by a bot. It may contain errors.
> See https://goo.gl/tpsmEJ for more information about syzbot.
> syzbot engineers can be reached at syzkaller@googlegroups.com.
> 
> syzbot will keep track of this bug report. See:
> https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
> syzbot can test patches for this bug, for details see:
> https://goo.gl/tpsmEJ#testing-patches
> 
> -- 
> You received this message because you are subscribed to the Google Groups "syzkaller-bugs" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller-bugs+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller-bugs/0000000000002a280b05a725cd93%40google.com.

  reply	other threads:[~2020-06-03  3:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-03  3:41 memory leak in crypto_create_tfm syzbot
2020-06-03  3:55 ` Eric Biggers [this message]
2020-06-03  8:08 ` [PATCH] crypto: DRBG - always try to free Jitter RNG instance Stephan Müller
2020-06-03 11:09   ` Dan Carpenter
2020-06-03 11:40     ` Stephan Mueller
2020-06-04  6:41     ` [PATCH v2] " Stephan Müller
2020-06-05  0:43       ` Eric Biggers
2020-06-05  5:58         ` Stephan Mueller
2020-06-05  6:16           ` Eric Biggers
2020-06-05  6:52             ` Stephan Mueller
2020-06-05 16:21               ` Eric Biggers
2020-06-07 13:07                 ` Stephan Müller
2020-06-07 13:20       ` [PATCH v3] " Stephan Müller
2020-06-12  6:49         ` Herbert Xu

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=20200603035541.GB50072@sol.localdomain \
    --to=ebiggers@kernel.org \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=smueller@chronox.de \
    --cc=syzbot+2e635807decef724a1fa@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /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).