syzbot


possible deadlock in vcs_read

Status: closed as invalid on 2017/10/31 10:38
Reported-by: syzbot+56511fd97463426bd26e021677290f91083bba94@syzkaller.appspotmail.com
First crash: 2411d, last: 2411d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in vcs_read (2) serial 37 2320d 2355d 0/26 auto-closed as invalid on 2019/02/22 10:34

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
4.13.0-next-20170912+ #20 Not tainted
------------------------------------------------------
syz-executor5/10329 is trying to acquire lock:
 (console_lock){+.+.}, at: [<ffffffff8271e539>] vcs_read+0x129/0xae0 drivers/tty/vt/vc_screen.c:218

but task is already holding lock:
 (&pipe->mutex/1){+.+.}, at: [<ffffffff81ac0fa6>] pipe_lock_nested fs/pipe.c:66 [inline]
 (&pipe->mutex/1){+.+.}, at: [<ffffffff81ac0fa6>] pipe_lock+0x56/0x70 fs/pipe.c:74

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #3 (&pipe->mutex/1){+.+.}:
       check_prevs_add kernel/locking/lockdep.c:2020 [inline]
       validate_chain kernel/locking/lockdep.c:2469 [inline]
       __lock_acquire+0x328f/0x4620 kernel/locking/lockdep.c:3498
       lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:4002
       __mutex_lock_common kernel/locking/mutex.c:756 [inline]
       __mutex_lock+0x16f/0x1870 kernel/locking/mutex.c:893
       mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908
       pipe_lock_nested fs/pipe.c:66 [inline]
       pipe_lock+0x56/0x70 fs/pipe.c:74
       iter_file_splice_write+0x264/0xf50 fs/splice.c:699
       do_splice_from fs/splice.c:851 [inline]
       do_splice fs/splice.c:1147 [inline]
       SYSC_splice fs/splice.c:1402 [inline]
       SyS_splice+0x7d5/0x1630 fs/splice.c:1382
       entry_SYSCALL_64_fastpath+0x1f/0xbe

-> #2 (sb_writers){.+.+}:
       percpu_down_read_preempt_disable include/linux/percpu-rwsem.h:35 [inline]
       percpu_down_read include/linux/percpu-rwsem.h:58 [inline]
       __sb_start_write+0x18f/0x290 fs/super.c:1341
       sb_start_write include/linux/fs.h:1541 [inline]
       mnt_want_write+0x3f/0xb0 fs/namespace.c:387
       filename_create+0x12b/0x520 fs/namei.c:3628
       kern_path_create+0x33/0x40 fs/namei.c:3674
       handle_create+0xc0/0x760 drivers/base/devtmpfs.c:203

-> #1 ((complete)&req.done){+.+.}:
       check_prevs_add kernel/locking/lockdep.c:2020 [inline]
       validate_chain kernel/locking/lockdep.c:2469 [inline]
       __lock_acquire+0x328f/0x4620 kernel/locking/lockdep.c:3498
       lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:4002
       complete_acquire include/linux/completion.h:39 [inline]
       __wait_for_common kernel/sched/completion.c:108 [inline]
       wait_for_common kernel/sched/completion.c:122 [inline]
       wait_for_completion+0xc8/0x770 kernel/sched/completion.c:143
       devtmpfs_create_node+0x32b/0x4a0 drivers/base/devtmpfs.c:115
       device_add+0x120f/0x1640 drivers/base/core.c:1824
       device_create_groups_vargs+0x1f3/0x250 drivers/base/core.c:2430
       device_create_vargs drivers/base/core.c:2470 [inline]
       device_create+0xda/0x110 drivers/base/core.c:2506
       vcs_make_sysfs+0x35/0x60 drivers/tty/vt/vc_screen.c:628
       vc_allocate+0x4b7/0x6b0 drivers/tty/vt/vt.c:795
       con_install+0x52/0x440 drivers/tty/vt/vt.c:2876
       tty_driver_install_tty drivers/tty/tty_io.c:1214 [inline]
       tty_init_dev+0xf6/0x4a0 drivers/tty/tty_io.c:1314
       tty_open_by_driver drivers/tty/tty_io.c:1941 [inline]
       tty_open+0x60f/0xac0 drivers/tty/tty_io.c:1989
       chrdev_open+0x257/0x730 fs/char_dev.c:416
       do_dentry_open+0x67f/0xd70 fs/open.c:752
       vfs_open+0x107/0x230 fs/open.c:866
       do_last fs/namei.c:3387 [inline]
       path_openat+0x1157/0x3520 fs/namei.c:3527
       do_filp_open+0x25b/0x3b0 fs/namei.c:3562
       do_sys_open+0x502/0x6d0 fs/open.c:1059
       SYSC_open fs/open.c:1077 [inline]
       SyS_open+0x2d/0x40 fs/open.c:1072
       entry_SYSCALL_64_fastpath+0x1f/0xbe

-> #0 (console_lock){+.+.}:
       check_prev_add+0x865/0x1520 kernel/locking/lockdep.c:1894
       check_prevs_add kernel/locking/lockdep.c:2020 [inline]
       validate_chain kernel/locking/lockdep.c:2469 [inline]
       __lock_acquire+0x328f/0x4620 kernel/locking/lockdep.c:3498
       lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:4002
       console_lock+0x4b/0x80 kernel/printk/printk.c:2047
       vcs_read+0x129/0xae0 drivers/tty/vt/vc_screen.c:218
       do_loop_readv_writev fs/read_write.c:693 [inline]
       do_iter_read+0x3db/0x5b0 fs/read_write.c:917
       vfs_readv+0x121/0x1c0 fs/read_write.c:979
       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
       do_splice fs/splice.c:1173 [inline]
       SYSC_splice fs/splice.c:1402 [inline]
       SyS_splice+0x11a8/0x1630 fs/splice.c:1382
       entry_SYSCALL_64_fastpath+0x1f/0xbe

other info that might help us debug this:

Chain exists of:
  console_lock --> sb_writers --> &pipe->mutex/1

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&pipe->mutex/1);
                               lock(sb_writers);
                               lock(&pipe->mutex/1);
  lock(console_lock);

 *** DEADLOCK ***

1 lock held by syz-executor5/10329:
 #0:  (&pipe->mutex/1){+.+.}, at: [<ffffffff81ac0fa6>] pipe_lock_nested fs/pipe.c:66 [inline]
 #0:  (&pipe->mutex/1){+.+.}, at: [<ffffffff81ac0fa6>] pipe_lock+0x56/0x70 fs/pipe.c:74

stack backtrace:
CPU: 1 PID: 10329 Comm: syz-executor5 Not tainted 4.13.0-next-20170912+ #20
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:16 [inline]
 dump_stack+0x194/0x257 lib/dump_stack.c:52
 print_circular_bug+0x503/0x710 kernel/locking/lockdep.c:1259
 check_prev_add+0x865/0x1520 kernel/locking/lockdep.c:1894
 check_prevs_add kernel/locking/lockdep.c:2020 [inline]
 validate_chain kernel/locking/lockdep.c:2469 [inline]
 __lock_acquire+0x328f/0x4620 kernel/locking/lockdep.c:3498
 lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:4002
 console_lock+0x4b/0x80 kernel/printk/printk.c:2047
 vcs_read+0x129/0xae0 drivers/tty/vt/vc_screen.c:218
 do_loop_readv_writev fs/read_write.c:693 [inline]
 do_iter_read+0x3db/0x5b0 fs/read_write.c:917
 vfs_readv+0x121/0x1c0 fs/read_write.c:979
 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
 do_splice fs/splice.c:1173 [inline]
 SYSC_splice fs/splice.c:1402 [inline]
 SyS_splice+0x11a8/0x1630 fs/splice.c:1382
 entry_SYSCALL_64_fastpath+0x1f/0xbe
RIP: 0033:0x451e59
RSP: 002b:00007f82a10a5c08 EFLAGS: 00000216 ORIG_RAX: 0000000000000113
RAX: ffffffffffffffda RBX: 00000000007180b0 RCX: 0000000000451e59
RDX: 000000000000001b RSI: 0000000000000000 RDI: 0000000000000017
RBP: 0000000000000082 R08: 000000005636d6e4 R09: 0000000000000002
R10: 0000000000000000 R11: 0000000000000216 R12: 00000000004b7397
R13: 00000000ffffffff R14: 00000000000000fb R15: fffffffffffffffc
TCP: request_sock_TCP: Possible SYN flooding on port 20000. Sending cookies.  Check SNMP counters.
netlink: 8 bytes leftover after parsing attributes in process `syz-executor0'.
netlink: 8 bytes leftover after parsing attributes in process `syz-executor0'.
kvm: vcpu 0: requested 68374 ns lapic timer period limited to 500000 ns
kvm: vcpu 0: requested 68374 ns lapic timer period limited to 500000 ns
kvm: vcpu 0: requested 68374 ns lapic timer period limited to 500000 ns
sctp: [Deprecated]: syz-executor2 (pid 10489) Use of struct sctp_assoc_value in delayed_ack socket option.
Use struct sctp_sack_info instead
sctp: [Deprecated]: syz-executor2 (pid 10499) Use of struct sctp_assoc_value in delayed_ack socket option.
Use struct sctp_sack_info instead
netlink: 5 bytes leftover after parsing attributes in process `syz-executor7'.
kvm: vcpu 0: requested 68374 ns lapic timer period limited to 500000 ns
kvm: vcpu 0: requested 68374 ns lapic timer period limited to 500000 ns
kvm: vcpu 0: requested 68374 ns lapic timer period limited to 500000 ns
kvm: vcpu 0: requested 68374 ns lapic timer period limited to 500000 ns
kvm: vcpu 0: requested 68374 ns lapic timer period limited to 500000 ns
kvm: vcpu 0: requested 68374 ns lapic timer period limited to 500000 ns
kvm: vcpu 0: requested 68374 ns lapic timer period limited to 500000 ns
QAT: Invalid ioctl
QAT: Invalid ioctl
SELinux: unrecognized netlink message: protocol=0 nlmsg_type=8 sclass=netlink_route_socket pig=10725 comm=syz-executor5
SELinux: unrecognized netlink message: protocol=0 nlmsg_type=8 sclass=netlink_route_socket pig=10725 comm=syz-executor5
QAT: Invalid ioctl
QAT: Invalid ioctl
PF_BRIDGE: RTM_NEWNEIGH with invalid ifindex
PF_BRIDGE: RTM_NEWNEIGH with invalid ifindex
kvm [10809]: vcpu0, guest rIP: 0xfff0 disabled perfctr wrmsr: 0x186 data 0x8
kvm [10809]: vcpu0, guest rIP: 0xfff0 disabled perfctr wrmsr: 0x186 data 0x8
netlink: 11 bytes leftover after parsing attributes in process `syz-executor3'.
nla_parse: 1 callbacks suppressed
netlink: 37 bytes leftover after parsing attributes in process `syz-executor3'.
netlink: 37 bytes leftover after parsing attributes in process `syz-executor3'.
netlink: 8 bytes leftover after parsing attributes in process `syz-executor6'.
FAULT_INJECTION: forcing a failure.
name failslab, interval 1, probability 0, space 0, times 1
CPU: 1 PID: 11839 Comm: syz-executor0 Not tainted 4.13.0-next-20170912+ #20
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:16 [inline]
 dump_stack+0x194/0x257 lib/dump_stack.c:52
 fail_dump lib/fault-inject.c:51 [inline]
 should_fail+0x8c0/0xa40 lib/fault-inject.c:149
 should_failslab+0xec/0x120 mm/failslab.c:31
 slab_pre_alloc_hook mm/slab.h:422 [inline]
 slab_alloc_node mm/slab.c:3304 [inline]
 kmem_cache_alloc_node+0x56/0x760 mm/slab.c:3649
 __alloc_skb+0xf1/0x740 net/core/skbuff.c:194
 alloc_skb include/linux/skbuff.h:976 [inline]
 pfkey_sendmsg+0x20f/0x9f0 net/key/af_key.c:3635
 sock_sendmsg_nosec net/socket.c:633 [inline]
 sock_sendmsg+0xca/0x110 net/socket.c:643
 sock_write_iter+0x320/0x5e0 net/socket.c:912
 call_write_iter include/linux/fs.h:1770 [inline]
 new_sync_write fs/read_write.c:468 [inline]
 __vfs_write+0x68a/0x970 fs/read_write.c:481
 vfs_write+0x18f/0x510 fs/read_write.c:543
 SYSC_write fs/read_write.c:588 [inline]
 SyS_write+0xef/0x220 fs/read_write.c:580
 entry_SYSCALL_64_fastpath+0x1f/0xbe
RIP: 0033:0x451e59
RSP: 002b:00007f16d1783c08 EFLAGS: 00000216 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000718000 RCX: 0000000000451e59
RDX: 0000000000000010 RSI: 000000002004b000 RDI: 0000000000000005
RBP: 00007f16d1783a10 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000216 R12: 00000000004b69f7
R13: 00007f16d1783b48 R14: 00000000004b6a07 R15: 0000000000000000
FAULT_INJECTION: forcing a failure.
name failslab, interval 1, probability 0, space 0, times 0
CPU: 0 PID: 11858 Comm: syz-executor3 Not tainted 4.13.0-next-20170912+ #20
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:16 [inline]
 dump_stack+0x194/0x257 lib/dump_stack.c:52
 fail_dump lib/fault-inject.c:51 [inline]
 should_fail+0x8c0/0xa40 lib/fault-inject.c:149
 should_failslab+0xec/0x120 mm/failslab.c:31
 slab_pre_alloc_hook mm/slab.h:422 [inline]
 slab_alloc_node mm/slab.c:3304 [inline]
 kmem_cache_alloc_node+0x56/0x760 mm/slab.c:3649
 __alloc_skb+0xf1/0x740 net/core/skbuff.c:194
 alloc_skb include/linux/skbuff.h:976 [inline]
 pfkey_sendmsg+0x20f/0x9f0 net/key/af_key.c:3635
 sock_sendmsg_nosec net/socket.c:633 [inline]
 sock_sendmsg+0xca/0x110 net/socket.c:643
 sock_write_iter+0x320/0x5e0 net/socket.c:912
 call_write_iter include/linux/fs.h:1770 [inline]
 new_sync_write fs/read_write.c:468 [inline]
 __vfs_write+0x68a/0x970 fs/read_write.c:481
 vfs_write+0x18f/0x510 fs/read_write.c:543
 SYSC_write fs/read_write.c:588 [inline]
 SyS_write+0xef/0x220 fs/read_write.c:580
 entry_SYSCALL_64_fastpath+0x1f/0xbe
RIP: 0033:0x451e59
RSP: 002b:00007f4d12385c08 EFLAGS: 00000216 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000718000 RCX: 0000000000451e59
RDX: 0000000000000010 RSI: 000000002004b000 RDI: 0000000000000005
RBP: 00007f4d12385a10 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000216 R12: 00000000004b69f7
R13: 00007f4d12385b48 R14: 00000000004b6a07 R15: 0000000000000000
netlink: 8 bytes leftover after parsing attributes in process `syz-executor4'.
netlink: 4 bytes leftover after parsing attributes in process `syz-executor4'.
tc_dump_action: action bad kind
netlink: 3 bytes leftover after parsing attributes in process `syz-executor3'.
netlink: 8 bytes leftover after parsing attributes in process `syz-executor4'.
netlink: 4 bytes leftover after parsing attributes in process `syz-executor4'.
tc_dump_action: action bad kind
netlink: 3 bytes leftover after parsing attributes in process `syz-executor3'.
netlink: 3 bytes leftover after parsing attributes in process `syz-executor3'.
FAULT_INJECTION: forcing a failure.
name failslab, interval 1, probability 0, space 0, times 0
CPU: 0 PID: 12035 Comm: syz-executor7 Not tainted 4.13.0-next-20170912+ #20
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:16 [inline]
 dump_stack+0x194/0x257 lib/dump_stack.c:52
 fail_dump lib/fault-inject.c:51 [inline]
 should_fail+0x8c0/0xa40 lib/fault-inject.c:149
 should_failslab+0xec/0x120 mm/failslab.c:31
 slab_pre_alloc_hook mm/slab.h:422 [inline]
 slab_alloc mm/slab.c:3383 [inline]
 __do_kmalloc mm/slab.c:3723 [inline]
 __kmalloc+0x63/0x760 mm/slab.c:3734
 kmalloc include/linux/slab.h:498 [inline]
 sock_kmalloc+0x112/0x190 net/core/sock.c:1974
 ipv6_sock_mc_join+0x506/0xa80 net/ipv6/mcast.c:158
 do_ipv6_setsockopt.isra.12+0x2f11/0x35c0 net/ipv6/ipv6_sockglue.c:636
 ipv6_setsockopt+0xd7/0x150 net/ipv6/ipv6_sockglue.c:913
 udpv6_setsockopt+0x45/0x80 net/ipv6/udp.c:1451
 sock_common_setsockopt+0x95/0xd0 net/core/sock.c:2960
 SYSC_setsockopt net/socket.c:1852 [inline]
 SyS_setsockopt+0x189/0x360 net/socket.c:1831
 entry_SYSCALL_64_fastpath+0x1f/0xbe
RIP: 0033:0x451e59
RSP: 002b:00007f2c9de61c08 EFLAGS: 00000216 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 0000000000718000 RCX: 0000000000451e59
RDX: 0000000000000014 RSI: 0000000000000029 RDI: 0000000000000005
RBP: 00007f2c9de61a10 R08: 0000000000000014 R09: 0000000000000000
R10: 0000000020599000 R11: 0000000000000216 R12: 00000000004b69f7
R13: 00007f2c9de61b48 R14: 00000000004b6a07 R15: 0000000000000000
nla_parse: 1 callbacks suppressed
netlink: 3 bytes leftover after parsing attributes in process `syz-executor1'.
netlink: 3 bytes leftover after parsing attributes in process `syz-executor1'.
netlink: 4 bytes leftover after parsing attributes in process `syz-executor1'.
netlink: 3 bytes leftover after parsing attributes in process `syz-executor1'.
netlink: 3 bytes leftover after parsing attributes in process `syz-executor1'.

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2017/09/12 12:48 linux-next 0d71e2d4aa14 0bd6a0a5 .config console log report ci-upstream-next-kasan-gce
* Struck through repros no longer work on HEAD.