====================================================== WARNING: possible circular locking dependency detected 4.13.0-rc6-next-20170825+ #9 Not tainted ------------------------------------------------------ kworker/0:2/1251 is trying to acquire lock: ((&w->work)){+.+.}, at: [] process_one_work+0xb2c/0x1be0 kernel/workqueue.c:2094 but now in release context of a crosslock acquired at the following: ((complete)wq_barr::done/1){+.+.}, at: [] flush_work+0x621/0x930 kernel/workqueue.c:2868 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 ((complete)wq_barr::done/1){+.+.}: 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 flush_work+0x621/0x930 kernel/workqueue.c:2868 lru_add_drain_all_cpuslocked+0x331/0x520 mm/swap.c:722 lru_add_drain_all+0x13/0x20 mm/swap.c:730 SYSC_mlockall mm/mlock.c:803 [inline] SyS_mlockall+0x2fb/0x670 mm/mlock.c:791 entry_SYSCALL_64_fastpath+0x1f/0xbe -> #2 (lock#5){+.+.}: 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 lru_add_drain_all_cpuslocked+0xb3/0x520 mm/swap.c:704 lru_add_drain_all+0x13/0x20 mm/swap.c:730 SYSC_mlockall mm/mlock.c:803 [inline] SyS_mlockall+0x2fb/0x670 mm/mlock.c:791 entry_SYSCALL_64_fastpath+0x1f/0xbe -> #1 (cpu_hotplug_lock.rw_sem){++++}: 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 percpu_down_read_preempt_disable include/linux/percpu-rwsem.h:35 [inline] percpu_down_read include/linux/percpu-rwsem.h:58 [inline] cpus_read_lock+0x42/0x90 kernel/cpu.c:218 __static_key_slow_dec kernel/jump_label.c:213 [inline] static_key_slow_dec+0x4a/0x90 kernel/jump_label.c:228 once_deferred+0x5c/0x90 lib/once.c:17 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 -> #0 ((&w->work)){+.+.}: 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 other info that might help us debug this: Chain exists of: (&w->work) --> lock#5 --> (complete)wq_barr::done/1 Possible unsafe locking scenario by crosslock: CPU0 CPU1 ---- ---- lock(lock#5); lock((complete)wq_barr::done/1); lock((&w->work)); unlock((complete)wq_barr::done/1); *** DEADLOCK *** 3 locks held by kworker/0:2/1251: #0: ("mm_percpu_wq"){++++}, at: [] __write_once_size include/linux/compiler.h:305 [inline] #0: ("mm_percpu_wq"){++++}, at: [] atomic64_set arch/x86/include/asm/atomic64_64.h:33 [inline] #0: ("mm_percpu_wq"){++++}, at: [] atomic_long_set include/asm-generic/atomic-long.h:56 [inline] #0: ("mm_percpu_wq"){++++}, at: [] set_work_data kernel/workqueue.c:617 [inline] #0: ("mm_percpu_wq"){++++}, at: [] set_work_pool_and_clear_pending kernel/workqueue.c:644 [inline] #0: ("mm_percpu_wq"){++++}, at: [] process_one_work+0xad4/0x1be0 kernel/workqueue.c:2090 #1: ((&barr->work)){+.+.}, at: [] process_one_work+0xb2c/0x1be0 kernel/workqueue.c:2094 #2: (&x->wait#14){....}, at: [] complete+0x18/0x80 kernel/sched/completion.c:34 stack backtrace: CPU: 0 PID: 1251 Comm: kworker/0:2 Not tainted 4.13.0-rc6-next-20170825+ #9 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 Workqueue: mm_percpu_wq wq_barrier_func 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 commit_xhlock kernel/locking/lockdep.c:5002 [inline] commit_xhlocks kernel/locking/lockdep.c:5046 [inline] lock_commit_crosslock+0xe73/0x1d10 kernel/locking/lockdep.c:5085 complete_release_commit include/linux/completion.h:49 [inline] complete+0x24/0x80 kernel/sched/completion.c:39 wq_barrier_func+0x16/0x20 kernel/workqueue.c:2437 process_one_work+0xbfd/0x1be0 kernel/workqueue.c:2098 process_scheduled_works kernel/workqueue.c:2159 [inline] worker_thread+0xa4b/0x1860 kernel/workqueue.c:2238 kthread+0x39c/0x470 kernel/kthread.c:231 ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:431 syz-executor3: vmalloc: allocation failure: 4833356120 bytes, mode:0x14080c0(GFP_KERNEL|__GFP_ZERO), nodemask=(null) syz-executor3 cpuset=/ mems_allowed=0-1 CPU: 1 PID: 3361 Comm: syz-executor3 Not tainted 4.13.0-rc6-next-20170825+ #9 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:16 [inline] dump_stack+0x194/0x257 lib/dump_stack.c:52 warn_alloc+0x1c2/0x2f0 mm/page_alloc.c:3254 __vmalloc_node_range+0x599/0x730 mm/vmalloc.c:1781 __vmalloc_node mm/vmalloc.c:1810 [inline] __vmalloc_node_flags_caller+0x50/0x60 mm/vmalloc.c:1832 kvmalloc_node+0x82/0xd0 mm/util.c:406 kvmalloc include/linux/mm.h:529 [inline] kvmalloc_array include/linux/mm.h:545 [inline] xt_alloc_entry_offsets+0x21/0x30 net/netfilter/x_tables.c:774 translate_table+0x235/0x1610 net/ipv4/netfilter/ip_tables.c:692 do_replace net/ipv4/netfilter/ip_tables.c:1135 [inline] do_ipt_set_ctl+0x34b/0x5c0 net/ipv4/netfilter/ip_tables.c:1669 nf_sockopt net/netfilter/nf_sockopt.c:105 [inline] nf_setsockopt+0x67/0xc0 net/netfilter/nf_sockopt.c:114 ip_setsockopt+0xa1/0xb0 net/ipv4/ip_sockglue.c:1251 tcp_setsockopt+0x82/0xd0 net/ipv4/tcp.c:2800 sock_common_setsockopt+0x95/0xd0 net/core/sock.c:2970 SYSC_setsockopt net/socket.c:1852 [inline] SyS_setsockopt+0x189/0x360 net/socket.c:1831 entry_SYSCALL_64_fastpath+0x1f/0xbe RIP: 0033:0x446749 RSP: 002b:00007ffab98e2c08 EFLAGS: 00000292 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 0000000000000017 RCX: 0000000000446749 RDX: 0000000000000040 RSI: 0000000000000000 RDI: 0000000000000017 RBP: 0000000000708000 R08: 0000000000000056 R09: 0000000000000000 R10: 0000000020006000 R11: 0000000000000292 R12: 00000000ffffffff R13: 00000000000056a0 R14: 00000000006e7760 R15: 0000200000000004 Mem-Info: active_anon:87855 inactive_anon:44 isolated_anon:0 active_file:3390 inactive_file:4668 isolated_file:0 unevictable:0 dirty:127 writeback:0 unstable:0 slab_reclaimable:4775 slab_unreclaimable:30384 mapped:20835 shmem:49 pagetables:786 bounce:0 free:260593 free_pcp:1007 free_cma:0 Node 0 active_anon:123084kB inactive_anon:72kB active_file:7732kB inactive_file:14648kB unevictable:0kB isolated(anon):0kB isolated(file):0kB mapped:38700kB dirty:128kB writeback:0kB shmem:80kB shmem_thp: 0kB shmem_pmdmapped: 0kB anon_thp: 0kB writeback_tmp:0kB unstable:0kB all_unreclaimable? no Node 1 active_anon:222192kB inactive_anon:104kB active_file:5828kB inactive_file:4024kB unevictable:0kB isolated(anon):0kB isolated(file):0kB mapped:44640kB dirty:380kB writeback:0kB shmem:116kB shmem_thp: 0kB shmem_pmdmapped: 0kB anon_thp: 47104kB writeback_tmp:0kB unstable:0kB all_unreclaimable? no Node 0 DMA free:15908kB min:640kB low:800kB high:960kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB writepending:0kB present:15992kB managed:15908kB mlocked:0kB kernel_stack:0kB pagetables:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB lowmem_reserve[]: 0 886 886 886 Node 0 DMA32 free:611604kB min:36536kB low:45668kB high:54800kB active_anon:139728kB inactive_anon:76kB active_file:7732kB inactive_file:14664kB unevictable:0kB writepending:144kB present:1032192kB managed:909748kB mlocked:0kB kernel_stack:3008kB pagetables:1456kB bounce:0kB free_pcp:2248kB local_pcp:716kB free_cma:0kB lowmem_reserve[]: 0 0 0 0 Node 1 DMA32 free:409484kB min:30404kB low:38004kB high:45604kB active_anon:218084kB inactive_anon:104kB active_file:5836kB inactive_file:4016kB unevictable:0kB writepending:380kB present:1048560kB managed:755216kB mlocked:0kB kernel_stack:1920kB pagetables:1804kB bounce:0kB free_pcp:1904kB local_pcp:356kB free_cma:0kB lowmem_reserve[]: 0 0 0 0 Node 0 DMA: 1*4kB (U) 0*8kB 0*16kB 1*32kB (U) 2*64kB (U) 1*128kB (U) 1*256kB (U) 0*512kB 1*1024kB (U) 1*2048kB (M) 3*4096kB (M) = 15908kB Node 0 DMA32: 2290*4kB (UM) 1977*8kB (UME) 1239*16kB (UM) 688*32kB (UM) 340*64kB (UM) 117*128kB (UME) 23*256kB (UME) 0*512kB 2*1024kB (UE) 1*2048kB (M) 121*4096kB (M) = 609152kB netlink: 1 bytes leftover after parsing attributes in process `syz-executor4'. do_dccp_setsockopt: sockopt(CHANGE_L/R) is deprecated: fix your app Node 1 DMA32: 1260*4kB (ME) 2062*8kB (UME) 1287*16kB (UME) 660*32kB (UME) 359*64kB (UM) 57*128kB (UM) 13*256kB (UM) 2*512kB (UM) 2*1024kB (ME) 1*2048kB (E) 75*4096kB (M) = 409168kB netlink: 1 bytes leftover after parsing attributes in process `syz-executor4'. Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB Node 1 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB 8111 total pagecache pages 0 pages in swap cache Swap cache stats: add 0, delete 0, find 0/0 Free swap = 0kB Total swap = 0kB 524186 pages RAM 0 pages HighMem/MovableOnly 103968 pages reserved syz-executor3: vmalloc: allocation failure: 4833356120 bytes, mode:0x14080c0(GFP_KERNEL|__GFP_ZERO), nodemask=(null) syz-executor3 cpuset=/ mems_allowed=0-1 CPU: 3 PID: 3361 Comm: syz-executor3 Not tainted 4.13.0-rc6-next-20170825+ #9 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:16 [inline] dump_stack+0x194/0x257 lib/dump_stack.c:52 warn_alloc+0x1c2/0x2f0 mm/page_alloc.c:3254 __vmalloc_node_range+0x599/0x730 mm/vmalloc.c:1781 __vmalloc_node mm/vmalloc.c:1810 [inline] __vmalloc_node_flags_caller+0x50/0x60 mm/vmalloc.c:1832 kvmalloc_node+0x82/0xd0 mm/util.c:406 kvmalloc include/linux/mm.h:529 [inline] kvmalloc_array include/linux/mm.h:545 [inline] xt_alloc_entry_offsets+0x21/0x30 net/netfilter/x_tables.c:774 translate_table+0x235/0x1610 net/ipv4/netfilter/ip_tables.c:692 do_replace net/ipv4/netfilter/ip_tables.c:1135 [inline] do_ipt_set_ctl+0x34b/0x5c0 net/ipv4/netfilter/ip_tables.c:1669 nf_sockopt net/netfilter/nf_sockopt.c:105 [inline] nf_setsockopt+0x67/0xc0 net/netfilter/nf_sockopt.c:114 ip_setsockopt+0xa1/0xb0 net/ipv4/ip_sockglue.c:1251 tcp_setsockopt+0x82/0xd0 net/ipv4/tcp.c:2800 sock_common_setsockopt+0x95/0xd0 net/core/sock.c:2970 SYSC_setsockopt net/socket.c:1852 [inline] SyS_setsockopt+0x189/0x360 net/socket.c:1831 entry_SYSCALL_64_fastpath+0x1f/0xbe RIP: 0033:0x446749 RSP: 002b:00007ffab98e2c08 EFLAGS: 00000292 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 000000000000001f RCX: 0000000000446749 RDX: 0000000000000040 RSI: 0000000000000000 RDI: 000000000000001f RBP: 0000000000708000 R08: 0000000000000056 R09: 0000000000000000 R10: 0000000020006000 R11: 0000000000000292 R12: 00000000ffffffff R13: 00000000000037c0 R14: 00000000006e5880 R15: 0000000000fff000 dccp_invalid_packet: pskb_may_pull failed dccp_invalid_packet: pskb_may_pull failed netlink: 3 bytes leftover after parsing attributes in process `syz-executor3'. sctp: [Deprecated]: syz-executor5 (pid 3429) Use of int in maxseg socket option. Use struct sctp_assoc_value instead netlink: 3 bytes leftover after parsing attributes in process `syz-executor3'. do_dccp_setsockopt: sockopt(CHANGE_L/R) is deprecated: fix your app sctp: [Deprecated]: syz-executor5 (pid 3468) Use of int in maxseg socket option. Use struct sctp_assoc_value instead netlink: 1 bytes leftover after parsing attributes in process `syz-executor3'. netlink: 1 bytes leftover after parsing attributes in process `syz-executor3'. mmap: syz-executor4 (3505) uses deprecated remap_file_pages() syscall. See Documentation/vm/remap_file_pages.txt. SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=3568 comm=syz-executor6 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=3568 comm=syz-executor6 QAT: Invalid ioctl QAT: Invalid ioctl hrtimer: interrupt took 27513 ns SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=3721 comm=syz-executor6 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=3721 comm=syz-executor6 netlink: 16 bytes leftover after parsing attributes in process `syz-executor3'. netlink: 16 bytes leftover after parsing attributes in process `syz-executor3'. capability: warning: `syz-executor4' uses deprecated v2 capabilities in a way that may be insecure audit: type=1326 audit(1503895708.126:2): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=3930 comm="syz-executor4" exe="/syz-executor4" sig=31 arch=c000003e syscall=202 compat=0 ip=0x446749 code=0xffff0000 kvm [4022]: vcpu0, guest rIP: 0x9135 Hyper-V unhandled rdmsr: 0x4000008f kvm [4022]: vcpu0, guest rIP: 0x9135 Hyper-V unhandled rdmsr: 0x4000008e kvm [4022]: vcpu0, guest rIP: 0x9135 Hyper-V unhandled rdmsr: 0x4000008d kvm [4022]: vcpu0, guest rIP: 0x9135 Hyper-V unhandled rdmsr: 0x4000008c kvm [4022]: vcpu0, guest rIP: 0x9135 Hyper-V unhandled rdmsr: 0x4000008b kvm [4022]: vcpu0, guest rIP: 0x9135 Hyper-V unhandled rdmsr: 0x4000008a kvm [4022]: vcpu0, guest rIP: 0x9135 Hyper-V unhandled rdmsr: 0x40000089 kvm [4022]: vcpu0, guest rIP: 0x9135 Hyper-V unhandled rdmsr: 0x40000088 kvm [4022]: vcpu0, guest rIP: 0x9135 Hyper-V unhandled rdmsr: 0x40000087 kvm [4022]: vcpu0, guest rIP: 0x9135 Hyper-V unhandled rdmsr: 0x40000086