Re: WARNING in _copy_to_user

From: Eric Biggers
Date: Tue Jan 30 2018 - 18:43:34 EST


On Fri, Dec 01, 2017 at 03:30:01AM -0800, syzbot wrote:
> Hello,
>
> syzkaller hit the following crash on
> df8ba95c572a187ed2aa7403e97a7a7f58c01f00
> git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/master
> compiler: gcc (GCC) 7.1.1 20170620
> .config is attached
> Raw console output is attached.
>
> Unfortunately, I don't have any reproducer for this bug yet.
>
>
>
> =====================================
> WARNING: bad unlock balance detected!
> 4.15.0-rc1+ #202 Not tainted
> -------------------------------------
> syz-executor4/28722 is trying to release lock (mrt_lock) at:
> [<00000000c358606b>] ipmr_mfc_seq_stop+0xe1/0x130 net/ipv6/ip6mr.c:553
> but there are no more locks to release!
>
> other info that might help us debug this:
> 2 locks held by syz-executor4/28722:
> #0: (sb_writers#6){.+.+}, at: [<000000003332d098>] file_start_write
> include/linux/fs.h:2715 [inline]
> #0: (sb_writers#6){.+.+}, at: [<000000003332d098>] do_sendfile+0xaec/0xe90
> fs/read_write.c:1412
> #1: (&p->lock){+.+.}, at: [<000000001572c807>] seq_read+0xd5/0x13d0
> fs/seq_file.c:165
>
> stack backtrace:
> CPU: 0 PID: 28722 Comm: syz-executor4 Not tainted 4.15.0-rc1+ #202
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
> Google 01/01/2011
> Call Trace:
> __dump_stack lib/dump_stack.c:17 [inline]
> dump_stack+0x194/0x257 lib/dump_stack.c:53
> print_unlock_imbalance_bug+0x12f/0x140 kernel/locking/lockdep.c:3561
> __lock_release kernel/locking/lockdep.c:3775 [inline]
> lock_release+0x5f9/0xda0 kernel/locking/lockdep.c:4023
> __raw_read_unlock include/linux/rwlock_api_smp.h:225 [inline]
> _raw_read_unlock+0x1a/0x30 kernel/locking/spinlock.c:255
> ipmr_mfc_seq_stop+0xe1/0x130 net/ipv6/ip6mr.c:553
> seq_read+0xc42/0x13d0 fs/seq_file.c:277
> proc_reg_read+0xef/0x170 fs/proc/inode.c:217
> do_loop_readv_writev fs/read_write.c:673 [inline]
> do_iter_read+0x3db/0x5b0 fs/read_write.c:897
> vfs_readv+0x121/0x1c0 fs/read_write.c:959
> kernel_readv fs/splice.c:361 [inline]
> default_file_splice_read+0x508/0xae0 fs/splice.c:416
> do_splice_to+0x110/0x170 fs/splice.c:880
> splice_direct_to_actor+0x242/0x820 fs/splice.c:952
> do_splice_direct+0x2a7/0x3d0 fs/splice.c:1061
> do_sendfile+0x5d5/0xe90 fs/read_write.c:1413
> SYSC_sendfile64 fs/read_write.c:1468 [inline]
> SyS_sendfile64+0xbd/0x160 fs/read_write.c:1460
> entry_SYSCALL_64_fastpath+0x1f/0x96
> RIP: 0033:0x4529d9
> RSP: 002b:00007f225b206c58 EFLAGS: 00000212 ORIG_RAX: 0000000000000028
> RAX: ffffffffffffffda RBX: 0000000000758020 RCX: 00000000004529d9
> RDX: 0000000020360ff8 RSI: 0000000000000014 RDI: 0000000000000014
> RBP: 0000000000000561 R08: 0000000000000000 R09: 0000000000000000
> R10: 0000000000000008 R11: 0000000000000212 R12: 00000000006f51b8
> R13: 00000000ffffffff R14: 00007f225b2076d4 R15: 0000000000000000
> WARNING: CPU: 0 PID: 28722 at lib/usercopy.c:26 _copy_to_user+0xb5/0xc0
> lib/usercopy.c:26
>
>
> ---
> This bug is generated by a dumb bot. It may contain errors.
> See https://goo.gl/tpsmEJ for details.
> Direct all questions to syzkaller@xxxxxxxxxxxxxxxxx
> Please credit me with: Reported-by: syzbot <syzkaller@xxxxxxxxxxxxxxxx>
>
> syzbot will keep track of this bug report.
> Once a fix for this bug is committed, please reply to this email with:
> #syz fix: exact-commit-title
> To mark this as a duplicate of another syzbot report, please reply with:
> #syz dup: exact-subject-of-another-report
> If it's a one-off invalid bug report, please reply with:
> #syz invalid

Duplicate of "WARNING: bad unlock balance in ipmr_mfc_seq_stop" which syzbot is
detecting under that crash signature now, so just invalidating this one:

#syz invalid