====================================================== WARNING: possible circular locking dependency detected 4.13.0-rc6-next-20170823+ #7 Not tainted ------------------------------------------------------ kworker/3:2/1388 is trying to acquire lock: (&kvm->irqfds.resampler_lock){+.+.}, at: [] irqfd_resampler_shutdown+0xe3/0x6b0 arch/x86/kvm/../../../virt/kvm/eventfd.c:98 but task is already holding lock: ((&irqfd->shutdown)){+.+.}, at: [] process_one_work+0xb2c/0x1be0 kernel/workqueue.c:2094 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 ((&irqfd->shutdown)){+.+.}: process_one_work+0xba5/0x1be0 kernel/workqueue.c:2095 worker_thread+0x223/0x1860 kernel/workqueue.c:2233 kthread+0x39c/0x470 kernel/kthread.c:231 ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:431 0xffffffffffffffff -> #1 ((complete)&rcu.completion){+.+.}: check_prevs_add kernel/locking/lockdep.c:2020 [inline] validate_chain kernel/locking/lockdep.c:2469 [inline] __lock_acquire+0x3286/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 __synchronize_srcu+0x1b5/0x250 kernel/rcu/srcutree.c:898 synchronize_srcu_expedited kernel/rcu/srcutree.c:923 [inline] synchronize_srcu+0x1a3/0x560 kernel/rcu/srcutree.c:974 kvm_irqfd_assign arch/x86/kvm/../../../virt/kvm/eventfd.c:364 [inline] kvm_irqfd+0x994/0x1d50 arch/x86/kvm/../../../virt/kvm/eventfd.c:572 kvm_vm_ioctl+0x1079/0x1c40 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3032 vfs_ioctl fs/ioctl.c:45 [inline] do_vfs_ioctl+0x1b1/0x1530 fs/ioctl.c:685 SYSC_ioctl fs/ioctl.c:700 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:691 do_syscall_64+0x26c/0x8c0 arch/x86/entry/common.c:287 return_from_SYSCALL_64+0x0/0x7a -> #0 (&kvm->irqfds.resampler_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+0x3286/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 irqfd_resampler_shutdown+0xe3/0x6b0 arch/x86/kvm/../../../virt/kvm/eventfd.c:98 irqfd_shutdown+0xd8/0x1a0 arch/x86/kvm/../../../virt/kvm/eventfd.c:137 process_one_work+0xbfd/0x1be0 kernel/workqueue.c:2098 worker_thread+0x223/0x1860 kernel/workqueue.c:2233 kthread+0x39c/0x470 kernel/kthread.c:231 ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:431 other info that might help us debug this: Chain exists of: &kvm->irqfds.resampler_lock --> (complete)&rcu.completion --> (&irqfd->shutdown) Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock((&irqfd->shutdown)); lock((complete)&rcu.completion); lock((&irqfd->shutdown)); lock(&kvm->irqfds.resampler_lock); *** DEADLOCK *** 2 locks held by kworker/3:2/1388: #0: ("kvm-irqfd-cleanup"){++++}, at: [] __write_once_size include/linux/compiler.h:305 [inline] #0: ("kvm-irqfd-cleanup"){++++}, at: [] atomic64_set arch/x86/include/asm/atomic64_64.h:33 [inline] #0: ("kvm-irqfd-cleanup"){++++}, at: [] atomic_long_set include/asm-generic/atomic-long.h:56 [inline] #0: ("kvm-irqfd-cleanup"){++++}, at: [] set_work_data kernel/workqueue.c:617 [inline] #0: ("kvm-irqfd-cleanup"){++++}, at: [] set_work_pool_and_clear_pending kernel/workqueue.c:644 [inline] #0: ("kvm-irqfd-cleanup"){++++}, at: [] process_one_work+0xad4/0x1be0 kernel/workqueue.c:2090 #1: ((&irqfd->shutdown)){+.+.}, at: [] process_one_work+0xb2c/0x1be0 kernel/workqueue.c:2094 stack backtrace: CPU: 3 PID: 1388 Comm: kworker/3:2 Not tainted 4.13.0-rc6-next-20170823+ #7 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 Workqueue: kvm-irqfd-cleanup irqfd_shutdown 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+0x3286/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 irqfd_resampler_shutdown+0xe3/0x6b0 arch/x86/kvm/../../../virt/kvm/eventfd.c:98 irqfd_shutdown+0xd8/0x1a0 arch/x86/kvm/../../../virt/kvm/eventfd.c:137 process_one_work+0xbfd/0x1be0 kernel/workqueue.c:2098 worker_thread+0x223/0x1860 kernel/workqueue.c:2233 kthread+0x39c/0x470 kernel/kthread.c:231 ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:431 syz-executor2 uses obsolete (PF_INET,SOCK_PACKET) netlink: 72 bytes leftover after parsing attributes in process `syz-executor4'. device  entered promiscuous mode device  left promiscuous mode netlink: 7 bytes leftover after parsing attributes in process `syz-executor6'. PF_BRIDGE: br_mdb_parse() with unknown ifindex SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=4254 comm=syz-executor6 netlink: 11 bytes leftover after parsing attributes in process `syz-executor5'. netlink: 1 bytes leftover after parsing attributes in process `syz-executor0'. netlink: 11 bytes leftover after parsing attributes in process `syz-executor5'. netlink: 1 bytes leftover after parsing attributes in process `syz-executor0'. device lo entered promiscuous mode audit: type=1326 audit(1503503378.203:10): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=4421 comm="syz-executor7" exe="/syz-executor7" sig=31 arch=c000003e syscall=202 compat=0 ip=0x446749 code=0xffff0000 audit: type=1326 audit(1503503378.361:11): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=4421 comm="syz-executor7" exe="/syz-executor7" sig=31 arch=c000003e syscall=202 compat=0 ip=0x446749 code=0xffff0000 audit: type=1326 audit(1503503378.427:12): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=4466 comm="syz-executor4" exe="/syz-executor4" sig=9 arch=c000003e syscall=202 compat=0 ip=0x446749 code=0x0 netlink: 16 bytes leftover after parsing attributes in process `syz-executor0'. audit: type=1326 audit(1503503378.548:13): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=4466 comm="syz-executor4" exe="/syz-executor4" sig=9 arch=c000003e syscall=202 compat=0 ip=0x446749 code=0x0 kvm [4594]: vcpu0, guest rIP: 0xfff0 disabled perfctr wrmsr: 0x186 data 0x8 kvm [4594]: vcpu0, guest rIP: 0xfff0 disabled perfctr wrmsr: 0x186 data 0x8 device lo entered promiscuous mode capability: warning: `syz-executor6' uses deprecated v2 capabilities in a way that may be insecure sctp: [Deprecated]: syz-executor4 (pid 4728) Use of struct sctp_assoc_value in delayed_ack socket option. Use struct sctp_sack_info instead sctp: [Deprecated]: syz-executor4 (pid 4736) Use of struct sctp_assoc_value in delayed_ack socket option. Use struct sctp_sack_info instead sg_write: data in/out 524252/2 bytes for SCSI command 0x25-- guessing data in; program syz-executor6 not setting count and/or reply_len properly QAT: Invalid ioctl xprt_adjust_timeout: rq_timeout = 0! audit: type=1326 audit(1503503380.146:14): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=4797 comm="syz-executor7" exe="/syz-executor7" sig=31 arch=c000003e syscall=202 compat=0 ip=0x446749 code=0xffff0000 xprt_adjust_timeout: rq_timeout = 0! audit: type=1326 audit(1503503380.306:15): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=4797 comm="syz-executor7" exe="/syz-executor7" sig=31 arch=c000003e syscall=202 compat=0 ip=0x446749 code=0xffff0000 QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl sctp: [Deprecated]: syz-executor2 (pid 4994) Use of int in max_burst socket option. Use struct sctp_assoc_value instead sctp: [Deprecated]: syz-executor2 (pid 5000) Use of int in max_burst socket option. Use struct sctp_assoc_value instead TCP: tcp_parse_options: Illegal window scaling value 255 > 14 received pit: kvm: requested 2514 ns i8254 timer period limited to 500000 ns pit: kvm: requested 2514 ns i8254 timer period limited to 500000 ns SELinux: unrecognized netlink message: protocol=0 nlmsg_type=7681 sclass=netlink_route_socket pig=5226 comm=syz-executor2 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=7681 sclass=netlink_route_socket pig=5226 comm=syz-executor2 nla_parse: 6 callbacks suppressed netlink: 13 bytes leftover after parsing attributes in process `syz-executor0'. netlink: 13 bytes leftover after parsing attributes in process `syz-executor0'. device syz4 entered promiscuous mode QAT: Invalid ioctl netlink: 1 bytes leftover after parsing attributes in process `syz-executor1'. netlink: 1 bytes leftover after parsing attributes in process `syz-executor1'. QAT: Invalid ioctl QAT: Invalid ioctl audit: type=1326 audit(1503503384.161:16): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=5579 comm="syz-executor4" exe="/syz-executor4" sig=9 arch=c000003e syscall=202 compat=0 ip=0x446749 code=0x0 audit: type=1326 audit(1503503384.290:17): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=5579 comm="syz-executor4" exe="/syz-executor4" sig=9 arch=c000003e syscall=202 compat=0 ip=0x446749 code=0x0 netlink: 1 bytes leftover after parsing attributes in process `syz-executor4'. netlink: 1 bytes leftover after parsing attributes in process `syz-executor4'.