================================
WARNING: inconsistent lock state
4.13.0-rc4+ #2 Not tainted
--------------------------------
inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage.
syzkaller251025/2915 [HC0[0]:SC0[0]:HE1:SE1] takes:
 (slock-AF_INET){+.?...}, at: [<ffffffff83527856>] spin_lock include/linux/spinlock.h:299 [inline]
 (slock-AF_INET){+.?...}, at: [<ffffffff83527856>] sk_clone_lock+0x446/0x1270 net/core/sock.c:1672
{IN-SOFTIRQ-W} state was registered at:
  mark_irqflags kernel/locking/lockdep.c:2945 [inline]
  __lock_acquire+0xcbb/0x3dc0 kernel/locking/lockdep.c:3324
  lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:3855
  __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:299 [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+0x1694/0x2de0 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:4417
  __netif_receive_skb+0x2c/0x1b0 net/core/dev.c:4455
  netif_receive_skb_internal+0xfd/0x4d0 net/core/dev.c:4525
  napi_skb_finish net/core/dev.c:4886 [inline]
  napi_gro_receive+0x3d0/0x500 net/core/dev.c:4917
  receive_buf+0xccd/0x5270 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:5527 [inline]
  net_rx_action+0x792/0x1910 net/core/dev.c:5593
  __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+0xfb/0x100 init/main.c:436
  start_kernel+0x70d/0x733 init/main.c:701
  x86_64_start_reservations+0x2a/0x2c arch/x86/kernel/head64.c:317
  x86_64_start_kernel+0x13c/0x149 arch/x86/kernel/head64.c:298
  verify_cpu+0x0/0xf1
irq event stamp: 10286
hardirqs last  enabled at (10284): [<ffffffff819f5577>] kmem_cache_free+0xd7/0x240 mm/slab.c:3764
hardirqs last disabled at (10285): [<ffffffff8141f40c>] __local_bh_enable_ip+0x5c/0x160 kernel/softirq.c:163
softirqs last  enabled at (10286): [<ffffffff82dd5b6d>] tun_rx_batched.isra.42+0x5bd/0x860 include/linux/spinlock.h:339
softirqs last disabled at (10238): [<ffffffff82dd5b6d>] tun_rx_batched.isra.42+0x5bd/0x860 include/linux/spinlock.h:339

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(slock-AF_INET);
  <Interrupt>
    lock(slock-AF_INET);

 *** DEADLOCK ***

1 lock held by syzkaller251025/2915:
 #0:  (slock-AF_INET){+.?...}, at: [<ffffffff83527856>] spin_lock include/linux/spinlock.h:299 [inline]
 #0:  (slock-AF_INET){+.?...}, at: [<ffffffff83527856>] sk_clone_lock+0x446/0x1270 net/core/sock.c:1672

stack backtrace:
CPU: 1 PID: 2915 Comm: syzkaller251025 Not tainted 4.13.0-rc4+ #2
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:2403
 valid_state kernel/locking/lockdep.c:2416 [inline]
 mark_lock_irq kernel/locking/lockdep.c:2618 [inline]
 mark_lock+0xe59/0x13d0 kernel/locking/lockdep.c:3087
 mark_held_locks+0xaf/0x100 kernel/locking/lockdep.c:2676
 __trace_hardirqs_on_caller kernel/locking/lockdep.c:2705 [inline]
 trace_hardirqs_on_caller+0x421/0x5c0 kernel/locking/lockdep.c:2752
 trace_hardirqs_on+0xd/0x10 kernel/locking/lockdep.c:2759
 __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:1743 [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:00007ffca06afba8 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: syzkaller251025/2915/0x00000002
INFO: lockdep is turned off.
Modules linked in: