================================ WARNING: inconsistent lock state 6.1.0-rc6-syzkaller-32662-g6d464646530f #0 Not tainted -------------------------------- inconsistent {IN-SOFTIRQ-R} -> {SOFTIRQ-ON-W} usage. syz-executor.4/24054 [HC0[0]:SC0[0]:HE1:SE1] takes: ffff0000cb81a938 (k-clock-AF_INET6){+++-}-{2:2}, at: l2tp_tunnel_register+0x354/0x79c net/l2tp/l2tp_core.c:1477 {IN-SOFTIRQ-R} state was registered at: lock_acquire+0x100/0x1f8 kernel/locking/lockdep.c:5668 __raw_read_lock_bh include/linux/rwlock_api_smp.h:176 [inline] _raw_read_lock_bh+0x64/0x7c kernel/locking/spinlock.c:252 rds_tcp_listen_data_ready+0x28/0xb0 net/rds/tcp_listen.c:239 tcp_child_process+0x1fc/0x2cc net/ipv4/tcp_minisocks.c:861 tcp_v4_rcv+0xe3c/0x11e8 net/ipv4/tcp_ipv4.c:2052 ip_protocol_deliver_rcu+0x224/0x414 net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x124/0x200 net/ipv4/ip_input.c:233 NF_HOOK include/linux/netfilter.h:302 [inline] ip_local_deliver+0xd0/0xf4 net/ipv4/ip_input.c:254 dst_input include/net/dst.h:455 [inline] ip_rcv_finish+0x16c/0x190 net/ipv4/ip_input.c:444 NF_HOOK include/linux/netfilter.h:302 [inline] ip_rcv+0x80/0xb0 net/ipv4/ip_input.c:564 __netif_receive_skb_one_core net/core/dev.c:5489 [inline] __netif_receive_skb+0x70/0x14c net/core/dev.c:5603 process_backlog+0x240/0x388 net/core/dev.c:5931 __napi_poll+0x5c/0x24c net/core/dev.c:6498 napi_poll+0x110/0x484 net/core/dev.c:6565 net_rx_action+0x18c/0x414 net/core/dev.c:6676 _stext+0x168/0x37c ____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:80 call_on_irq_stack+0x2c/0x54 arch/arm64/kernel/entry.S:892 do_softirq_own_stack+0x20/0x2c arch/arm64/kernel/irq.c:85 do_softirq+0xac/0x108 kernel/softirq.c:472 __local_bh_enable_ip+0x18c/0x1a4 kernel/softirq.c:396 local_bh_enable+0x28/0x34 include/linux/bottom_half.h:33 rcu_read_unlock_bh include/linux/rcupdate.h:808 [inline] ip_finish_output2+0x7ac/0x818 net/ipv4/ip_output.c:229 __ip_finish_output+0x108/0x29c ip_finish_output+0x168/0x188 net/ipv4/ip_output.c:316 NF_HOOK_COND include/linux/netfilter.h:291 [inline] ip_output+0x1d4/0x234 net/ipv4/ip_output.c:430 dst_output include/net/dst.h:445 [inline] ip_local_out net/ipv4/ip_output.c:126 [inline] __ip_queue_xmit+0x740/0x8e4 net/ipv4/ip_output.c:532 ip_queue_xmit+0x38/0x4c net/ipv4/ip_output.c:546 __tcp_transmit_skb+0xaf4/0xe60 net/ipv4/tcp_output.c:1402 __tcp_send_ack+0x138/0x1b4 net/ipv4/tcp_output.c:3986 tcp_send_ack+0x24/0x34 net/ipv4/tcp_output.c:3992 tcp_rcv_synsent_state_process+0x8e0/0x974 net/ipv4/tcp_input.c:6313 tcp_rcv_state_process+0x118/0xe60 net/ipv4/tcp_input.c:6489 tcp_v4_do_rcv+0x3f0/0x51c net/ipv4/tcp_ipv4.c:1704 sk_backlog_rcv include/net/sock.h:1109 [inline] __release_sock+0xe4/0x1d0 net/core/sock.c:2906 release_sock+0x40/0x108 net/core/sock.c:3462 inet_wait_for_connect net/ipv4/af_inet.c:598 [inline] __inet_stream_connect+0x2f4/0x55c net/ipv4/af_inet.c:690 inet_stream_connect+0x4c/0x74 net/ipv4/af_inet.c:729 mptcp_connect+0x294/0x4f4 net/mptcp/protocol.c:3573 __inet_stream_connect+0x124/0x55c net/ipv4/af_inet.c:665 mptcp_stream_connect+0x54/0x7c net/mptcp/protocol.c:3657 __sys_connect_file net/socket.c:1976 [inline] __sys_connect+0x184/0x190 net/socket.c:1993 __do_sys_connect net/socket.c:2003 [inline] __se_sys_connect net/socket.c:2000 [inline] __arm64_sys_connect+0x28/0x3c net/socket.c:2000 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall arch/arm64/kernel/syscall.c:52 [inline] el0_svc_common+0x138/0x220 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x48/0x164 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x150 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:584 irq event stamp: 2355 hardirqs last enabled at (2355): [] __local_bh_enable_ip+0x13c/0x1a4 kernel/softirq.c:401 hardirqs last disabled at (2353): [] __local_bh_enable_ip+0xc4/0x1a4 kernel/softirq.c:378 softirqs last enabled at (2354): [] spin_unlock_bh include/linux/spinlock.h:395 [inline] softirqs last enabled at (2354): [] release_sock+0xf4/0x108 net/core/sock.c:3473 softirqs last disabled at (2352): [] spin_lock_bh include/linux/spinlock.h:355 [inline] softirqs last disabled at (2352): [] release_sock+0x2c/0x108 net/core/sock.c:3460 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(k-clock-AF_INET6); lock(k-clock-AF_INET6); *** DEADLOCK *** 2 locks held by syz-executor.4/24054: #0: ffff80000d894668 (cb_lock){++++}-{3:3}, at: genl_rcv+0x28/0x50 net/netlink/genetlink.c:860 #1: ffff80000d894578 (genl_mutex){+.+.}-{3:3}, at: genl_lock net/netlink/genetlink.c:33 [inline] #1: ffff80000d894578 (genl_mutex){+.+.}-{3:3}, at: genl_rcv_msg+0x80/0x4f4 net/netlink/genetlink.c:848 stack backtrace: CPU: 1 PID: 24054 Comm: syz-executor.4 Not tainted 6.1.0-rc6-syzkaller-32662-g6d464646530f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/30/2022 Call trace: dump_backtrace+0x1c4/0x1f0 arch/arm64/kernel/stacktrace.c:156 show_stack+0x2c/0x54 arch/arm64/kernel/stacktrace.c:163 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x104/0x16c lib/dump_stack.c:106 dump_stack+0x1c/0x58 lib/dump_stack.c:113 print_usage_bug+0x39c/0x3cc kernel/locking/lockdep.c:3963 mark_lock_irq+0x4a8/0x4b4 mark_lock+0x154/0x1b4 kernel/locking/lockdep.c:4634 __lock_acquire+0x618/0x3084 kernel/locking/lockdep.c:5009 lock_acquire+0x100/0x1f8 kernel/locking/lockdep.c:5668 __raw_write_lock include/linux/rwlock_api_smp.h:209 [inline] _raw_write_lock+0x54/0x6c kernel/locking/spinlock.c:300 l2tp_tunnel_register+0x354/0x79c net/l2tp/l2tp_core.c:1477 l2tp_nl_cmd_tunnel_create+0x1f8/0x330 net/l2tp/l2tp_netlink.c:245 genl_family_rcv_msg_doit net/netlink/genetlink.c:756 [inline] genl_family_rcv_msg net/netlink/genetlink.c:833 [inline] genl_rcv_msg+0x458/0x4f4 net/netlink/genetlink.c:850 netlink_rcv_skb+0xe8/0x1d4 net/netlink/af_netlink.c:2540 genl_rcv+0x38/0x50 net/netlink/genetlink.c:861 netlink_unicast_kernel+0xfc/0x1dc net/netlink/af_netlink.c:1319 netlink_unicast+0x164/0x248 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x484/0x584 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg net/socket.c:734 [inline] ____sys_sendmsg+0x2f8/0x440 net/socket.c:2482 ___sys_sendmsg net/socket.c:2536 [inline] __sys_sendmsg+0x1ac/0x228 net/socket.c:2565 __do_sys_sendmsg net/socket.c:2574 [inline] __se_sys_sendmsg net/socket.c:2572 [inline] __arm64_sys_sendmsg+0x2c/0x3c net/socket.c:2572 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall arch/arm64/kernel/syscall.c:52 [inline] el0_svc_common+0x138/0x220 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x48/0x164 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x150 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:584 BUG: sleeping function called from invalid context at include/linux/percpu-rwsem.h:49 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 24054, name: syz-executor.4 preempt_count: 1, expected: 0 RCU nest depth: 0, expected: 0 INFO: lockdep is turned off. Preemption disabled at: [] l2tp_tunnel_register+0x354/0x79c net/l2tp/l2tp_core.c:1477 CPU: 1 PID: 24054 Comm: syz-executor.4 Not tainted 6.1.0-rc6-syzkaller-32662-g6d464646530f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/30/2022 Call trace: dump_backtrace+0x1c4/0x1f0 arch/arm64/kernel/stacktrace.c:156 show_stack+0x2c/0x54 arch/arm64/kernel/stacktrace.c:163 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x104/0x16c lib/dump_stack.c:106 dump_stack+0x1c/0x58 lib/dump_stack.c:113 __might_resched+0x208/0x218 kernel/sched/core.c:9908 __might_sleep+0x48/0x78 kernel/sched/core.c:9837 percpu_down_read include/linux/percpu-rwsem.h:49 [inline] cpus_read_lock+0x28/0x1e0 kernel/cpu.c:310 static_key_slow_inc+0x1c/0x38 kernel/jump_label.c:158 udpv6_encap_enable+0x1c/0x28 net/ipv6/udp.c:473 udp_tunnel_encap_enable include/net/udp_tunnel.h:187 [inline] setup_udp_tunnel_sock+0xec/0x124 net/ipv4/udp_tunnel_core.c:81 l2tp_tunnel_register+0x68c/0x79c net/l2tp/l2tp_core.c:1509 l2tp_nl_cmd_tunnel_create+0x1f8/0x330 net/l2tp/l2tp_netlink.c:245 genl_family_rcv_msg_doit net/netlink/genetlink.c:756 [inline] genl_family_rcv_msg net/netlink/genetlink.c:833 [inline] genl_rcv_msg+0x458/0x4f4 net/netlink/genetlink.c:850 netlink_rcv_skb+0xe8/0x1d4 net/netlink/af_netlink.c:2540 genl_rcv+0x38/0x50 net/netlink/genetlink.c:861 netlink_unicast_kernel+0xfc/0x1dc net/netlink/af_netlink.c:1319 netlink_unicast+0x164/0x248 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x484/0x584 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg net/socket.c:734 [inline] ____sys_sendmsg+0x2f8/0x440 net/socket.c:2482 ___sys_sendmsg net/socket.c:2536 [inline] __sys_sendmsg+0x1ac/0x228 net/socket.c:2565 __do_sys_sendmsg net/socket.c:2574 [inline] __se_sys_sendmsg net/socket.c:2572 [inline] __arm64_sys_sendmsg+0x2c/0x3c net/socket.c:2572 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall arch/arm64/kernel/syscall.c:52 [inline] el0_svc_common+0x138/0x220 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x48/0x164 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x150 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:584