linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: syzbot <syzbot+f7baccc38dcc1e094e77@syzkaller.appspotmail.com>
To: davem@davemloft.net, herbert@gondor.apana.org.au,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	syzkaller-bugs@googlegroups.com
Subject: memory leak in mpihelp_mul_karatsuba_case
Date: Mon, 24 Jun 2019 00:27:08 -0700	[thread overview]
Message-ID: <000000000000617b4a058c0cbd60@google.com> (raw)

Hello,

syzbot found the following crash on:

HEAD commit:    abf02e29 Merge tag 'pm-5.2-rc6' of git://git.kernel.org/pu..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=17a8bfeaa00000
kernel config:  https://syzkaller.appspot.com/x/.config?x=56f1da14935c3cce
dashboard link: https://syzkaller.appspot.com/bug?extid=f7baccc38dcc1e094e77
compiler:       gcc (GCC) 9.0.0 20181231 (experimental)
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=171aa7e6a00000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=153306cea00000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+f7baccc38dcc1e094e77@syzkaller.appspotmail.com

ffffffffda RBX: 0000000000000000 RCX: 0000000000441ac9
BUG: memory leak
unreferenced object 0xffff88811f4da200 (size 512):
   comm "syz-executor301", pid 7045, jiffies 4294955450 (age 7.850s)
   hex dump (first 32 bytes):
     ad dc f4 43 66 b0 1a 88 8f 0c 17 d5 86 34 3a 85  ...Cf........4:.
     e3 63 c8 bf 2e 3b f5 0d 1c ab 63 30 15 fe a1 e9  .c...;....c0....
   backtrace:
     [<00000000d5589961>] kmemleak_alloc_recursive  
include/linux/kmemleak.h:43 [inline]
     [<00000000d5589961>] slab_post_alloc_hook mm/slab.h:439 [inline]
     [<00000000d5589961>] slab_alloc mm/slab.c:3326 [inline]
     [<00000000d5589961>] __do_kmalloc mm/slab.c:3658 [inline]
     [<00000000d5589961>] __kmalloc+0x161/0x2c0 mm/slab.c:3669
     [<00000000022eaa00>] kmalloc include/linux/slab.h:552 [inline]
     [<00000000022eaa00>] mpi_alloc_limb_space+0x29/0x50 lib/mpi/mpiutil.c:64
     [<00000000d637c699>] mpihelp_mul_karatsuba_case+0x67/0x460  
lib/mpi/mpih-mul.c:331
     [<00000000401dc6f9>] mpi_powm+0x7b0/0xdd0 lib/mpi/mpi-pow.c:225
     [<00000000be8dcb84>] _compute_val crypto/dh.c:39 [inline]
     [<00000000be8dcb84>] dh_compute_value+0x160/0x220 crypto/dh.c:178
     [<00000000471846ad>] crypto_kpp_generate_public_key  
include/crypto/kpp.h:315 [inline]
     [<00000000471846ad>] __keyctl_dh_compute+0x447/0x970  
security/keys/dh.c:367
     [<000000002f6d650d>] keyctl_dh_compute+0x67/0xa6 security/keys/dh.c:422
     [<00000000b798bc7f>] __do_sys_keyctl security/keys/keyctl.c:1737  
[inline]
     [<00000000b798bc7f>] __se_sys_keyctl security/keys/keyctl.c:1633  
[inline]
     [<00000000b798bc7f>] __x64_sys_keyctl+0xa5/0x330  
security/keys/keyctl.c:1633
     [<000000007a6f9515>] do_syscall_64+0x76/0x1a0  
arch/x86/entry/common.c:301
     [<00000000057f2768>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88811f4dac00 (size 512):
   comm "syz-executor301", pid 7045, jiffies 4294955450 (age 7.850s)
   hex dump (first 32 bytes):
     62 72 c4 ae ac af a3 ba e5 24 da a5 30 5e cb c4  br.......$..0^..
     a6 46 44 39 76 2e 42 f6 85 6a 5b ad ae 97 4e 83  .FD9v.B..j[...N.
   backtrace:
     [<00000000d5589961>] kmemleak_alloc_recursive  
include/linux/kmemleak.h:43 [inline]
     [<00000000d5589961>] slab_post_alloc_hook mm/slab.h:439 [inline]
     [<00000000d5589961>] slab_alloc mm/slab.c:3326 [inline]
     [<00000000d5589961>] __do_kmalloc mm/slab.c:3658 [inline]
     [<00000000d5589961>] __kmalloc+0x161/0x2c0 mm/slab.c:3669
     [<00000000022eaa00>] kmalloc include/linux/slab.h:552 [inline]
     [<00000000022eaa00>] mpi_alloc_limb_space+0x29/0x50 lib/mpi/mpiutil.c:64
     [<0000000025804541>] mpihelp_mul_karatsuba_case+0x394/0x460  
lib/mpi/mpih-mul.c:346
     [<00000000401dc6f9>] mpi_powm+0x7b0/0xdd0 lib/mpi/mpi-pow.c:225
     [<00000000be8dcb84>] _compute_val crypto/dh.c:39 [inline]
     [<00000000be8dcb84>] dh_compute_value+0x160/0x220 crypto/dh.c:178
     [<00000000471846ad>] crypto_kpp_generate_public_key  
include/crypto/kpp.h:315 [inline]
     [<00000000471846ad>] __keyctl_dh_compute+0x447/0x970  
security/keys/dh.c:367
     [<000000002f6d650d>] keyctl_dh_compute+0x67/0xa6 security/keys/dh.c:422
     [<00000000b798bc7f>] __do_sys_keyctl security/keys/keyctl.c:1737  
[inline]
     [<00000000b798bc7f>] __se_sys_keyctl security/keys/keyctl.c:1633  
[inline]
     [<00000000b798bc7f>] __x64_sys_keyctl+0xa5/0x330  
security/keys/keyctl.c:1633
     [<000000007a6f9515>] do_syscall_64+0x76/0x1a0  
arch/x86/entry/common.c:301
     [<00000000057f2768>] 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

             reply	other threads:[~2019-06-24  7:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-24  7:27 syzbot [this message]
2019-06-24 10:32 ` lib/mpi: Fix karactx leak in mpi_powm Herbert Xu
2019-06-24 21:17   ` Eric Biggers

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=000000000000617b4a058c0cbd60@google.com \
    --to=syzbot+f7baccc38dcc1e094e77@syzkaller.appspotmail.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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).