linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: syzbot <syzbot+4b1fe8105f8044a26162@syzkaller.appspotmail.com>,
	bfields@fieldses.org, jlayton@kernel.org,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	syzkaller-bugs@googlegroups.com, viro@zeniv.linux.org.uk,
	Ursula Braun <ubraun@linux.ibm.com>,
	Karsten Graul <kgraul@linux.ibm.com>
Subject: Re: memory leak in fasync_helper
Date: Sat, 7 Dec 2019 21:51:46 -0800	[thread overview]
Message-ID: <50681a5e-96e1-da38-e936-f817389c8b65@gmail.com> (raw)
In-Reply-To: <00000000000023dba505992ac8aa@google.com>



On 12/7/19 9:45 PM, syzbot wrote:
> Hello,
> 
> syzbot found the following crash on:
> 
> HEAD commit:    bf929479 Merge branch 'for-linus' of git://git.kernel.org/..
> git tree:       upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=123e91e2e00000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=874c75a332209d41
> dashboard link: https://syzkaller.appspot.com/bug?extid=4b1fe8105f8044a26162
> compiler:       gcc (GCC) 9.0.0 20181231 (experimental)
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=120faee2e00000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=178a0ef6e00000
> 
> IMPORTANT: if you fix the bug, please add the following tag to the commit:
> Reported-by: syzbot+4b1fe8105f8044a26162@syzkaller.appspotmail.com
> 
> BUG: memory leak
> unreferenced object 0xffff88812a4082a0 (size 48):
>   comm "syz-executor670", pid 6989, jiffies 4294952355 (age 19.520s)
>   hex dump (first 32 bytes):
>     00 00 00 00 00 00 00 00 01 46 00 00 03 00 00 00  .........F......
>     00 00 00 00 00 00 00 00 00 6b 05 1f 81 88 ff ff  .........k......
>   backtrace:
>     [<000000002a74b343>] kmemleak_alloc_recursive include/linux/kmemleak.h:43 [inline]
>     [<000000002a74b343>] slab_post_alloc_hook mm/slab.h:586 [inline]
>     [<000000002a74b343>] slab_alloc mm/slab.c:3319 [inline]
>     [<000000002a74b343>] kmem_cache_alloc+0x13f/0x2c0 mm/slab.c:3483
>     [<00000000fa370506>] fasync_alloc fs/fcntl.c:895 [inline]
>     [<00000000fa370506>] fasync_add_entry fs/fcntl.c:953 [inline]
>     [<00000000fa370506>] fasync_helper+0x37/0xa9 fs/fcntl.c:982
>     [<000000006c3eaaf1>] sock_fasync+0x4d/0xa0 net/socket.c:1293
>     [<0000000098076f55>] ioctl_fioasync fs/ioctl.c:550 [inline]
>     [<0000000098076f55>] do_vfs_ioctl+0x409/0x810 fs/ioctl.c:655
>     [<00000000df24d2b9>] ksys_ioctl+0x86/0xb0 fs/ioctl.c:713
>     [<000000003fec9c80>] __do_sys_ioctl fs/ioctl.c:720 [inline]
>     [<000000003fec9c80>] __se_sys_ioctl fs/ioctl.c:718 [inline]
>     [<000000003fec9c80>] __x64_sys_ioctl+0x1e/0x30 fs/ioctl.c:718
>     [<000000002bebbfe6>] do_syscall_64+0x73/0x1f0 arch/x86/entry/common.c:290
>     [<00000000722d8431>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
> 
> BUG: memory leak
> unreferenced object 0xffff888128cdf240 (size 48):
>   comm "syz-executor670", pid 6990, jiffies 4294952942 (age 13.650s)
>   hex dump (first 32 bytes):
>     00 00 00 00 00 00 00 00 01 46 00 00 03 00 00 00  .........F......
>     00 00 00 00 00 00 00 00 00 d8 02 19 81 88 ff ff  ................
>   backtrace:
>     [<000000002a74b343>] kmemleak_alloc_recursive include/linux/kmemleak.h:43 [inline]
>     [<000000002a74b343>] slab_post_alloc_hook mm/slab.h:586 [inline]
>     [<000000002a74b343>] slab_alloc mm/slab.c:3319 [inline]
>     [<000000002a74b343>] kmem_cache_alloc+0x13f/0x2c0 mm/slab.c:3483
>     [<00000000fa370506>] fasync_alloc fs/fcntl.c:895 [inline]
>     [<00000000fa370506>] fasync_add_entry fs/fcntl.c:953 [inline]
>     [<00000000fa370506>] fasync_helper+0x37/0xa9 fs/fcntl.c:982
>     [<000000006c3eaaf1>] sock_fasync+0x4d/0xa0 net/socket.c:1293
>     [<0000000098076f55>] ioctl_fioasync fs/ioctl.c:550 [inline]
>     [<0000000098076f55>] do_vfs_ioctl+0x409/0x810 fs/ioctl.c:655
>     [<00000000df24d2b9>] ksys_ioctl+0x86/0xb0 fs/ioctl.c:713
>     [<000000003fec9c80>] __do_sys_ioctl fs/ioctl.c:720 [inline]
>     [<000000003fec9c80>] __se_sys_ioctl fs/ioctl.c:718 [inline]
>     [<000000003fec9c80>] __x64_sys_ioctl+0x1e/0x30 fs/ioctl.c:718
>     [<000000002bebbfe6>] do_syscall_64+0x73/0x1f0 arch/x86/entry/common.c:290
>     [<00000000722d8431>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
> 
> BUG: memory leak
> unreferenced object 0xffff888128cdff60 (size 48):
>   comm "syz-executor670", pid 6991, jiffies 4294953529 (age 7.780s)
>   hex dump (first 32 bytes):
>     00 00 00 00 00 00 00 00 01 46 00 00 03 00 00 00  .........F......
>     00 00 00 00 00 00 00 00 00 63 05 1f 81 88 ff ff  .........c......
>   backtrace:
>     [<000000002a74b343>] kmemleak_alloc_recursive include/linux/kmemleak.h:43 [inline]
>     [<000000002a74b343>] slab_post_alloc_hook mm/slab.h:586 [inline]
>     [<000000002a74b343>] slab_alloc mm/slab.c:3319 [inline]
>     [<000000002a74b343>] kmem_cache_alloc+0x13f/0x2c0 mm/slab.c:3483
>     [<00000000fa370506>] fasync_alloc fs/fcntl.c:895 [inline]
>     [<00000000fa370506>] fasync_add_entry fs/fcntl.c:953 [inline]
>     [<00000000fa370506>] fasync_helper+0x37/0xa9 fs/fcntl.c:982
>     [<000000006c3eaaf1>] sock_fasync+0x4d/0xa0 net/socket.c:1293
>     [<0000000098076f55>] ioctl_fioasync fs/ioctl.c:550 [inline]
>     [<0000000098076f55>] do_vfs_ioctl+0x409/0x810 fs/ioctl.c:655
>     [<00000000df24d2b9>] ksys_ioctl+0x86/0xb0 fs/ioctl.c:713
>     [<000000003fec9c80>] __do_sys_ioctl fs/ioctl.c:720 [inline]
>     [<000000003fec9c80>] __se_sys_ioctl fs/ioctl.c:718 [inline]
>     [<000000003fec9c80>] __x64_sys_ioctl+0x1e/0x30 fs/ioctl.c:718
>     [<000000002bebbfe6>] do_syscall_64+0x73/0x1f0 arch/x86/entry/common.c:290
>     [<00000000722d8431>] 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-patche


AF_SMC bug it seems....

Repro does essentially :

socket(AF_SMC, SOCK_STREAM, SMCPROTO_SMC) = 3
ioctl(3, FIOASYNC, [-1])   = 0
sendmsg(3, {msg_name=NULL, msg_namelen=0, msg_iov=NULL, msg_iovlen=0, msg_controllen=0, msg_flags=0}, MSG_FASTOPEN)


console logs :

__sock_release: fasync list not empty!



  reply	other threads:[~2019-12-08  5:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-08  5:45 memory leak in fasync_helper syzbot
2019-12-08  5:51 ` Eric Dumazet [this message]
2019-12-10 17:49   ` Ursula Braun

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=50681a5e-96e1-da38-e936-f817389c8b65@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=bfields@fieldses.org \
    --cc=jlayton@kernel.org \
    --cc=kgraul@linux.ibm.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+4b1fe8105f8044a26162@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=ubraun@linux.ibm.com \
    --cc=viro@zeniv.linux.org.uk \
    /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).