netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: syzbot <syzbot+06537213db7ba2745c4a@syzkaller.appspotmail.com>
To: aviadye@mellanox.com, borisp@mellanox.com, daniel@iogearbox.net,
	davejwatson@fb.com, davem@davemloft.net,
	john.fastabend@gmail.com, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: memory leak in create_ctx
Date: Sun, 30 Jun 2019 22:40:00 -0700	[thread overview]
Message-ID: <000000000000255dbd058c980f22@google.com> (raw)
In-Reply-To: <5d1999ff323f_18a42abda71925b4cf@john-XPS-13-9370.notmuch>

Hello,

syzbot has tested the proposed patch but the reproducer still triggered  
crash:
memory leak in create_ctx

2019/07/01 05:38:26 executed programs: 23
BUG: memory leak
unreferenced object 0xffff888102914e00 (size 512):
   comm "syz-executor.4", pid 7333, jiffies 4294944085 (age 13.950s)
   hex dump (first 32 bytes):
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
   backtrace:
     [<000000002f2bb8be>] kmemleak_alloc_recursive  
include/linux/kmemleak.h:55 [inline]
     [<000000002f2bb8be>] slab_post_alloc_hook mm/slab.h:439 [inline]
     [<000000002f2bb8be>] slab_alloc mm/slab.c:3326 [inline]
     [<000000002f2bb8be>] kmem_cache_alloc_trace+0x13d/0x280 mm/slab.c:3553
     [<00000000b76aef16>] kmalloc include/linux/slab.h:547 [inline]
     [<00000000b76aef16>] kzalloc include/linux/slab.h:742 [inline]
     [<00000000b76aef16>] create_ctx+0x25/0x70 net/tls/tls_main.c:648
     [<00000000dc9c9d2e>] tls_init net/tls/tls_main.c:837 [inline]
     [<00000000dc9c9d2e>] tls_init+0x97/0x1f0 net/tls/tls_main.c:819
     [<000000009d663c39>] __tcp_set_ulp net/ipv4/tcp_ulp.c:126 [inline]
     [<000000009d663c39>] tcp_set_ulp+0xe2/0x190 net/ipv4/tcp_ulp.c:147
     [<00000000551f7621>] do_tcp_setsockopt.isra.0+0x19a/0xd60  
net/ipv4/tcp.c:2789
     [<00000000d02c41d7>] tcp_setsockopt+0x71/0x80 net/ipv4/tcp.c:3103
     [<0000000085d221c1>] sock_common_setsockopt+0x38/0x50  
net/core/sock.c:3129
     [<00000000d294eeda>] __sys_setsockopt+0x98/0x120 net/socket.c:2072
     [<00000000f1f1d607>] __do_sys_setsockopt net/socket.c:2083 [inline]
     [<00000000f1f1d607>] __se_sys_setsockopt net/socket.c:2080 [inline]
     [<00000000f1f1d607>] __x64_sys_setsockopt+0x26/0x30 net/socket.c:2080
     [<00000000fbd4f794>] do_syscall_64+0x76/0x1a0  
arch/x86/entry/common.c:301
     [<000000007383b736>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff888103860c00 (size 512):
   comm "syz-executor.0", pid 7342, jiffies 4294944115 (age 13.650s)
   hex dump (first 32 bytes):
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
   backtrace:
     [<000000002f2bb8be>] kmemleak_alloc_recursive  
include/linux/kmemleak.h:55 [inline]
     [<000000002f2bb8be>] slab_post_alloc_hook mm/slab.h:439 [inline]
     [<000000002f2bb8be>] slab_alloc mm/slab.c:3326 [inline]
     [<000000002f2bb8be>] kmem_cache_alloc_trace+0x13d/0x280 mm/slab.c:3553
     [<00000000b76aef16>] kmalloc include/linux/slab.h:547 [inline]
     [<00000000b76aef16>] kzalloc include/linux/slab.h:742 [inline]
     [<00000000b76aef16>] create_ctx+0x25/0x70 net/tls/tls_main.c:648
     [<00000000dc9c9d2e>] tls_init net/tls/tls_main.c:837 [inline]
     [<00000000dc9c9d2e>] tls_init+0x97/0x1f0 net/tls/tls_main.c:819
     [<000000009d663c39>] __tcp_set_ulp net/ipv4/tcp_ulp.c:126 [inline]
     [<000000009d663c39>] tcp_set_ulp+0xe2/0x190 net/ipv4/tcp_ulp.c:147
     [<00000000551f7621>] do_tcp_setsockopt.isra.0+0x19a/0xd60  
net/ipv4/tcp.c:2789
     [<00000000d02c41d7>] tcp_setsockopt+0x71/0x80 net/ipv4/tcp.c:3103
     [<0000000085d221c1>] sock_common_setsockopt+0x38/0x50  
net/core/sock.c:3129
     [<00000000d294eeda>] __sys_setsockopt+0x98/0x120 net/socket.c:2072
     [<00000000f1f1d607>] __do_sys_setsockopt net/socket.c:2083 [inline]
     [<00000000f1f1d607>] __se_sys_setsockopt net/socket.c:2080 [inline]
     [<00000000f1f1d607>] __x64_sys_setsockopt+0x26/0x30 net/socket.c:2080
     [<00000000fbd4f794>] do_syscall_64+0x76/0x1a0  
arch/x86/entry/common.c:301
     [<000000007383b736>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88810e3e1c00 (size 512):
   comm "syz-executor.5", pid 7384, jiffies 4294944151 (age 13.290s)
   hex dump (first 32 bytes):
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
   backtrace:
     [<000000002f2bb8be>] kmemleak_alloc_recursive  
include/linux/kmemleak.h:55 [inline]
     [<000000002f2bb8be>] slab_post_alloc_hook mm/slab.h:439 [inline]
     [<000000002f2bb8be>] slab_alloc mm/slab.c:3326 [inline]
     [<000000002f2bb8be>] kmem_cache_alloc_trace+0x13d/0x280 mm/slab.c:3553
     [<00000000b76aef16>] kmalloc include/linux/slab.h:547 [inline]
     [<00000000b76aef16>] kzalloc include/linux/slab.h:742 [inline]
     [<00000000b76aef16>] create_ctx+0x25/0x70 net/tls/tls_main.c:648
     [<00000000dc9c9d2e>] tls_init net/tls/tls_main.c:837 [inline]
     [<00000000dc9c9d2e>] tls_init+0x97/0x1f0 net/tls/tls_main.c:819
     [<000000009d663c39>] __tcp_set_ulp net/ipv4/tcp_ulp.c:126 [inline]
     [<000000009d663c39>] tcp_set_ulp+0xe2/0x190 net/ipv4/tcp_ulp.c:147
     [<00000000551f7621>] do_tcp_setsockopt.isra.0+0x19a/0xd60  
net/ipv4/tcp.c:2789
     [<00000000d02c41d7>] tcp_setsockopt+0x71/0x80 net/ipv4/tcp.c:3103
     [<0000000085d221c1>] sock_common_setsockopt+0x38/0x50  
net/core/sock.c:3129
     [<00000000d294eeda>] __sys_setsockopt+0x98/0x120 net/socket.c:2072
     [<00000000f1f1d607>] __do_sys_setsockopt net/socket.c:2083 [inline]
     [<00000000f1f1d607>] __se_sys_setsockopt net/socket.c:2080 [inline]
     [<00000000f1f1d607>] __x64_sys_setsockopt+0x26/0x30 net/socket.c:2080
     [<00000000fbd4f794>] do_syscall_64+0x76/0x1a0  
arch/x86/entry/common.c:301
     [<000000007383b736>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88811a0a7200 (size 512):
   comm "syz-executor.0", pid 7423, jiffies 4294944702 (age 7.780s)
   hex dump (first 32 bytes):
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
   backtrace:
     [<000000002f2bb8be>] kmemleak_alloc_recursive  
include/linux/kmemleak.h:55 [inline]
     [<000000002f2bb8be>] slab_post_alloc_hook mm/slab.h:439 [inline]
     [<000000002f2bb8be>] slab_alloc mm/slab.c:3326 [inline]
     [<000000002f2bb8be>] kmem_cache_alloc_trace+0x13d/0x280 mm/slab.c:3553
     [<00000000b76aef16>] kmalloc include/linux/slab.h:547 [inline]
     [<00000000b76aef16>] kzalloc include/linux/slab.h:742 [inline]
     [<00000000b76aef16>] create_ctx+0x25/0x70 net/tls/tls_main.c:648
     [<00000000dc9c9d2e>] tls_init net/tls/tls_main.c:837 [inline]
     [<00000000dc9c9d2e>] tls_init+0x97/0x1f0 net/tls/tls_main.c:819
     [<000000009d663c39>] __tcp_set_ulp net/ipv4/tcp_ulp.c:126 [inline]
     [<000000009d663c39>] tcp_set_ulp+0xe2/0x190 net/ipv4/tcp_ulp.c:147
     [<00000000551f7621>] do_tcp_setsockopt.isra.0+0x19a/0xd60  
net/ipv4/tcp.c:2789
     [<00000000d02c41d7>] tcp_setsockopt+0x71/0x80 net/ipv4/tcp.c:3103
     [<0000000085d221c1>] sock_common_setsockopt+0x38/0x50  
net/core/sock.c:3129
     [<00000000d294eeda>] __sys_setsockopt+0x98/0x120 net/socket.c:2072
     [<00000000f1f1d607>] __do_sys_setsockopt net/socket.c:2083 [inline]
     [<00000000f1f1d607>] __se_sys_setsockopt net/socket.c:2080 [inline]
     [<00000000f1f1d607>] __x64_sys_setsockopt+0x26/0x30 net/socket.c:2080
     [<00000000fbd4f794>] do_syscall_64+0x76/0x1a0  
arch/x86/entry/common.c:301
     [<000000007383b736>] entry_SYSCALL_64_after_hwframe+0x44/0xa9



Tested on:

commit:         0b58d013 bpf: tls, implement unhash to avoid transition ou..
git tree:       git://github.com/cilium/linux ktls-unhash
console output: https://syzkaller.appspot.com/x/log.txt?x=134f2e0ba00000
kernel config:  https://syzkaller.appspot.com/x/.config?x=3bd5897d1df43b97
compiler:       gcc (GCC) 9.0.0 20181231 (experimental)


  reply	other threads:[~2019-07-01  5:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-08 19:13 memory leak in create_ctx syzbot
2019-06-08 23:47 ` Jakub Kicinski
2019-06-10 20:59 ` [net/tls] " Eric Biggers
2019-07-01  5:28 ` John Fastabend
2019-07-01  5:40   ` syzbot [this message]
     [not found] <20190609025641.11448-1-hdanton@sina.com>
2019-06-11 11:45 ` Dmitry Vyukov
2019-06-11 17:16   ` Jakub Kicinski
     [not found] <20190612045828.10212-1-hdanton@sina.com>
2019-06-14  4:21 ` John Fastabend

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=000000000000255dbd058c980f22@google.com \
    --to=syzbot+06537213db7ba2745c4a@syzkaller.appspotmail.com \
    --cc=aviadye@mellanox.com \
    --cc=borisp@mellanox.com \
    --cc=daniel@iogearbox.net \
    --cc=davejwatson@fb.com \
    --cc=davem@davemloft.net \
    --cc=john.fastabend@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@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).