================================ WARNING: inconsistent lock state 4.13.0-rc4-next-20170811 #1 Not tainted -------------------------------- inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage. syzkaller094957/2942 [HC0[0]:SC0[0]:HE1:SE1] takes: (slock-AF_INET){+.?.}, at: [] spin_lock include/linux/spinlock.h:293 [inline] (slock-AF_INET){+.?.}, at: [] sk_clone_lock+0x446/0x1270 net/core/sock.c:1672 {IN-SOFTIRQ-W} state was registered at: mark_irqflags kernel/locking/lockdep.c:3077 [inline] __lock_acquire+0x1770/0x3bc0 kernel/locking/lockdep.c:3455 lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:4002 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:151 spin_lock include/linux/spinlock.h:293 [inline] sk_clone_lock+0x446/0x1270 net/core/sock.c:1672 inet_csk_clone_lock+0x92/0x4f0 net/ipv4/inet_connection_sock.c:782 tcp_create_openreq_child+0x7e/0x1b60 net/ipv4/tcp_minisocks.c:430 tcp_v4_syn_recv_sock+0x113/0x1150 net/ipv4/tcp_ipv4.c:1345 tcp_check_req+0xe7f/0x1620 net/ipv4/tcp_minisocks.c:755 tcp_v4_rcv+0x1693/0x2dd0 net/ipv4/tcp_ipv4.c:1670 ip_local_deliver_finish+0x2e2/0xba0 net/ipv4/ip_input.c:216 NF_HOOK include/linux/netfilter.h:248 [inline] ip_local_deliver+0x1ce/0x6d0 net/ipv4/ip_input.c:257 dst_input include/net/dst.h:477 [inline] ip_rcv_finish+0x8db/0x19c0 net/ipv4/ip_input.c:397 NF_HOOK include/linux/netfilter.h:248 [inline] ip_rcv+0xc3f/0x17d0 net/ipv4/ip_input.c:488 __netif_receive_skb_core+0x19af/0x33d0 net/core/dev.c:4418 __netif_receive_skb+0x2c/0x1b0 net/core/dev.c:4456 netif_receive_skb_internal+0xfd/0x4d0 net/core/dev.c:4526 napi_skb_finish net/core/dev.c:4887 [inline] napi_gro_receive+0x3d0/0x500 net/core/dev.c:4918 receive_buf+0xccd/0x52a0 drivers/net/virtio_net.c:839 virtnet_receive drivers/net/virtio_net.c:1085 [inline] virtnet_poll+0x304/0xad0 drivers/net/virtio_net.c:1166 napi_poll net/core/dev.c:5528 [inline] net_rx_action+0x792/0x1910 net/core/dev.c:5594 __do_softirq+0x2f5/0xba3 kernel/softirq.c:284 invoke_softirq kernel/softirq.c:364 [inline] irq_exit+0x1cc/0x200 kernel/softirq.c:405 exiting_irq arch/x86/include/asm/apic.h:638 [inline] do_IRQ+0xf6/0x190 arch/x86/kernel/irq.c:256 ret_from_intr+0x0/0x1e native_safe_halt+0x6/0x10 arch/x86/include/asm/irqflags.h:53 arch_safe_halt arch/x86/include/asm/paravirt.h:98 [inline] default_idle+0xbf/0x460 arch/x86/kernel/process.c:341 arch_cpu_idle+0xa/0x10 arch/x86/kernel/process.c:332 default_idle_call+0x36/0x90 kernel/sched/idle.c:98 cpuidle_idle_call kernel/sched/idle.c:156 [inline] do_idle+0x256/0x3b0 kernel/sched/idle.c:246 cpu_startup_entry+0x18/0x20 kernel/sched/idle.c:351 rest_init+0xed/0xf0 init/main.c:435 start_kernel+0x75f/0x785 init/main.c:708 x86_64_start_reservations+0x2a/0x2c arch/x86/kernel/head64.c:378 x86_64_start_kernel+0x13c/0x149 arch/x86/kernel/head64.c:359 verify_cpu+0x0/0xfb irq event stamp: 10394 hardirqs last enabled at (10392): [] kmem_cache_free+0xd7/0x240 mm/slab.c:3764 hardirqs last disabled at (10393): [] __local_bh_enable_ip+0x5c/0x160 kernel/softirq.c:163 softirqs last enabled at (10394): [] tun_rx_batched.isra.42+0x5bd/0x860 include/linux/spinlock.h:333 softirqs last disabled at (10350): [] tun_rx_batched.isra.42+0x5bd/0x860 include/linux/spinlock.h:333 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(slock-AF_INET); lock(slock-AF_INET); *** DEADLOCK *** 1 lock held by syzkaller094957/2942: #0: (slock-AF_INET){+.?.}, at: [] spin_lock include/linux/spinlock.h:293 [inline] #0: (slock-AF_INET){+.?.}, at: [] sk_clone_lock+0x446/0x1270 net/core/sock.c:1672 stack backtrace: CPU: 1 PID: 2942 Comm: syzkaller094957 Not tainted 4.13.0-rc4-next-20170811 #1 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_usage_bug+0x421/0x480 kernel/locking/lockdep.c:2594 valid_state kernel/locking/lockdep.c:2607 [inline] mark_lock_irq kernel/locking/lockdep.c:2801 [inline] mark_lock+0xe59/0x13d0 kernel/locking/lockdep.c:3199 mark_held_locks+0xaf/0x100 kernel/locking/lockdep.c:2859 __trace_hardirqs_on_caller kernel/locking/lockdep.c:2888 [inline] trace_hardirqs_on_caller+0x421/0x5c0 kernel/locking/lockdep.c:2935 trace_hardirqs_on+0xd/0x10 kernel/locking/lockdep.c:2942 __local_bh_enable_ip+0x9d/0x160 kernel/softirq.c:186 local_bh_enable include/linux/bottom_half.h:31 [inline] tun_rx_batched.isra.42+0x5fd/0x860 drivers/net/tun.c:1168 tun_get_user+0x1076/0x28f0 drivers/net/tun.c:1339 tun_chr_write_iter+0xd8/0x190 drivers/net/tun.c:1365 call_write_iter include/linux/fs.h:1742 [inline] new_sync_write fs/read_write.c:457 [inline] __vfs_write+0x684/0x970 fs/read_write.c:470 vfs_write+0x189/0x510 fs/read_write.c:518 SYSC_write fs/read_write.c:565 [inline] SyS_write+0xef/0x220 fs/read_write.c:557 entry_SYSCALL_64_fastpath+0x1f/0xbe RIP: 0033:0x4016f0 RSP: 002b:00007ffe13482668 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00000000006d6ee0 RCX: 00000000004016f0 RDX: 0000000000000036 RSI: 0000000020004000 RDI: 0000000000000003 RBP: 0000000000000086 R08: 0000000000000013 R09: 0000000000000052 R10: 0000000020016ff0 R11: 0000000000000246 R12: 00000000004025e0 R13: 0000000000402670 R14: 0000000000000000 R15: 0000000000000000 BUG: scheduling while atomic: syzkaller094957/2942/0x00000002 INFO: lockdep is turned off. Modules linked in: