================================ WARNING: inconsistent lock state 5.9.0-rc5-next-20200916-syzkaller #0 Not tainted -------------------------------- inconsistent {IN-SOFTIRQ-R} -> {SOFTIRQ-ON-W} usage. syz-executor.2/25909 [HC0[0]:SC0[0]:HE1:SE1] takes: ffff888093967790 (&s->seqcount#10){+.+-}-{0:0}, at: xfrm_user_rcv_msg+0x414/0x700 net/xfrm/xfrm_user.c:2684 {IN-SOFTIRQ-R} state was registered at: lock_acquire+0x1f2/0xaa0 kernel/locking/lockdep.c:5398 seqcount_lockdep_reader_access+0x139/0x1a0 include/linux/seqlock.h:103 xfrm_policy_lookup_inexact_addr+0x57/0x200 net/xfrm/xfrm_policy.c:1909 xfrm_policy_find_inexact_candidates+0xac/0x1d0 net/xfrm/xfrm_policy.c:1953 xfrm_policy_lookup_bytype+0x4b8/0xa40 net/xfrm/xfrm_policy.c:2108 xfrm_policy_lookup net/xfrm/xfrm_policy.c:2144 [inline] __xfrm_policy_check+0x110e/0x2650 net/xfrm/xfrm_policy.c:3572 __xfrm_policy_check2 include/net/xfrm.h:1101 [inline] xfrm_policy_check include/net/xfrm.h:1106 [inline] xfrm4_policy_check include/net/xfrm.h:1111 [inline] vti_input+0x538/0x810 net/ipv4/ip_vti.c:58 xfrm4_ah_rcv+0xb1/0x210 net/ipv4/xfrm4_protocol.c:132 ip_protocol_deliver_rcu+0x5c/0x880 net/ipv4/ip_input.c:204 ip_local_deliver_finish+0x20a/0x370 net/ipv4/ip_input.c:231 NF_HOOK include/linux/netfilter.h:301 [inline] NF_HOOK include/linux/netfilter.h:295 [inline] ip_local_deliver+0x1b3/0x200 net/ipv4/ip_input.c:252 dst_input include/net/dst.h:449 [inline] ip_rcv_finish+0x1da/0x2f0 net/ipv4/ip_input.c:428 NF_HOOK include/linux/netfilter.h:301 [inline] NF_HOOK include/linux/netfilter.h:295 [inline] ip_rcv+0xaa/0xd0 net/ipv4/ip_input.c:539 __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5287 __netif_receive_skb+0x27/0x1c0 net/core/dev.c:5401 process_backlog+0x2e1/0x8e0 net/core/dev.c:6286 napi_poll net/core/dev.c:6730 [inline] net_rx_action+0x572/0x1300 net/core/dev.c:6800 __do_softirq+0x202/0xa42 kernel/softirq.c:298 asm_call_on_stack+0xf/0x20 arch/x86/entry/entry_64.S:786 __run_on_irqstack arch/x86/include/asm/irq_stack.h:22 [inline] run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:48 [inline] do_softirq_own_stack+0x9d/0xd0 arch/x86/kernel/irq_64.c:77 invoke_softirq kernel/softirq.c:393 [inline] __irq_exit_rcu kernel/softirq.c:423 [inline] irq_exit_rcu+0x235/0x280 kernel/softirq.c:435 sysvec_apic_timer_interrupt+0x51/0xf0 arch/x86/kernel/apic/apic.c:1091 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:631 arch_local_irq_restore arch/x86/include/asm/paravirt.h:653 [inline] enqueue_to_backlog+0x562/0xfc0 net/core/dev.c:4543 netif_rx_internal+0x120/0x640 net/core/dev.c:4793 netif_rx_ni+0x89/0x590 net/core/dev.c:4834 dev_loopback_xmit+0x204/0x590 net/core/dev.c:3852 ip_mc_finish_output+0x16d/0x490 net/ipv4/ip_output.c:357 NF_HOOK include/linux/netfilter.h:301 [inline] NF_HOOK include/linux/netfilter.h:295 [inline] ip_mc_output+0x624/0x700 net/ipv4/ip_output.c:396 dst_output include/net/dst.h:443 [inline] ip_local_out net/ipv4/ip_output.c:126 [inline] ip_send_skb net/ipv4/ip_output.c:1568 [inline] ip_push_pending_frames+0x125/0x2b0 net/ipv4/ip_output.c:1588 raw_sendmsg+0x130e/0x2d40 net/ipv4/raw.c:673 inet_sendmsg+0x99/0xe0 net/ipv4/af_inet.c:817 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:671 sock_no_sendpage+0xee/0x130 net/core/sock.c:2838 inet_sendpage+0x103/0x140 net/ipv4/af_inet.c:832 kernel_sendpage net/socket.c:3653 [inline] sock_sendpage+0xe5/0x140 net/socket.c:944 pipe_to_sendpage+0x2ad/0x380 fs/splice.c:365 splice_from_pipe_feed fs/splice.c:419 [inline] __splice_from_pipe+0x3dc/0x830 fs/splice.c:543 splice_from_pipe fs/splice.c:578 [inline] generic_splice_sendpage+0xd4/0x140 fs/splice.c:724 do_splice_from fs/splice.c:745 [inline] do_splice+0xb80/0x1770 fs/splice.c:1042 __do_sys_splice fs/splice.c:1317 [inline] __se_sys_splice fs/splice.c:1299 [inline] __x64_sys_splice+0x198/0x250 fs/splice.c:1299 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 irq event stamp: 109 hardirqs last enabled at (109): [] __local_bh_enable_ip+0x10f/0x1f0 kernel/softirq.c:200 hardirqs last disabled at (107): [] __local_bh_enable_ip+0x154/0x1f0 kernel/softirq.c:177 softirqs last enabled at (108): [] rcu_read_unlock_bh include/linux/rcupdate.h:726 [inline] softirqs last enabled at (108): [] __dev_queue_xmit+0x1a7e/0x2d10 net/core/dev.c:4164 softirqs last disabled at (98): [] __dev_queue_xmit+0x1d7/0x2d10 net/core/dev.c:4072 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&s->seqcount#10); lock(&s->seqcount#10); *** DEADLOCK *** 2 locks held by syz-executor.2/25909: #0: ffff888093967b28 (&net->xfrm.xfrm_cfg_mutex){+.+.}-{3:3}, at: xfrm_netlink_rcv+0x5c/0x90 net/xfrm/xfrm_user.c:2691 #1: ffff8880939677d8 (&(&net->xfrm.policy_hthresh.lock)->lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:354 [inline] #1: ffff8880939677d8 (&(&net->xfrm.policy_hthresh.lock)->lock){+.+.}-{2:2}, at: write_seqlock include/linux/seqlock.h:882 [inline] #1: ffff8880939677d8 (&(&net->xfrm.policy_hthresh.lock)->lock){+.+.}-{2:2}, at: xfrm_set_spdinfo+0x2b8/0x660 net/xfrm/xfrm_user.c:1185 stack backtrace: CPU: 0 PID: 25909 Comm: syz-executor.2 Not tainted 5.9.0-rc5-next-20200916-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x198/0x1fb lib/dump_stack.c:118 print_usage_bug kernel/locking/lockdep.c:4377 [inline] valid_state kernel/locking/lockdep.c:3705 [inline] mark_lock_irq kernel/locking/lockdep.c:3914 [inline] mark_lock.cold+0x6f/0x10d kernel/locking/lockdep.c:4375 mark_usage kernel/locking/lockdep.c:4278 [inline] __lock_acquire+0x882/0x55d0 kernel/locking/lockdep.c:4750 lock_acquire+0x1f2/0xaa0 kernel/locking/lockdep.c:5398 write_seqcount_t_begin_nested include/linux/seqlock.h:509 [inline] write_seqcount_t_begin include/linux/seqlock.h:535 [inline] write_seqlock include/linux/seqlock.h:883 [inline] xfrm_set_spdinfo+0x302/0x660 net/xfrm/xfrm_user.c:1185 xfrm_user_rcv_msg+0x414/0x700 net/xfrm/xfrm_user.c:2684 netlink_rcv_skb+0x15a/0x430 net/netlink/af_netlink.c:2470 xfrm_netlink_rcv+0x6b/0x90 net/xfrm/xfrm_user.c:2692 netlink_unicast_kernel net/netlink/af_netlink.c:1304 [inline] netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1330 netlink_sendmsg+0x856/0xd90 net/netlink/af_netlink.c:1919 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:671 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2362 ___sys_sendmsg+0xf3/0x170 net/socket.c:2416 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2449 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45d5f9 Code: 5d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 2b b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f5a7747dc78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 000000000002cf80 RCX: 000000000045d5f9 RDX: 0000000000000000 RSI: 00000000200001c0 RDI: 0000000000000003 RBP: 000000000118cf80 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118cf4c R13: 00007ffc10d084ff R14: 00007f5a7747e9c0 R15: 000000000118cf4c