================================ WARNING: inconsistent lock state 6.1.0-rc5-syzkaller-01477-g7a168f560e3c #0 Not tainted -------------------------------- inconsistent {IN-SOFTIRQ-R} -> {SOFTIRQ-ON-W} usage. syz-executor.0/3960 [HC0[0]:SC0[0]:HE1:SE1] takes: ffff888049f3dbb8 (clock-AF_INET6){+++-}-{2:2}, at: l2tp_tunnel_register+0x126/0x1210 net/l2tp/l2tp_core.c:1477 {IN-SOFTIRQ-R} state was registered at: lock_acquire kernel/locking/lockdep.c:5668 [inline] lock_acquire+0x1e3/0x630 kernel/locking/lockdep.c:5633 __raw_read_lock_bh include/linux/rwlock_api_smp.h:176 [inline] _raw_read_lock_bh+0x3f/0x70 kernel/locking/spinlock.c:252 rds_tcp_listen_data_ready+0x21/0x160 net/rds/tcp_listen.c:239 tcp_data_ready+0x10a/0x520 net/ipv4/tcp_input.c:5005 tcp_data_queue+0x1baa/0x4c50 net/ipv4/tcp_input.c:5079 tcp_rcv_state_process+0x176a/0x4990 net/ipv4/tcp_input.c:6691 tcp_child_process+0x3dd/0xad0 net/ipv4/tcp_minisocks.c:858 tcp_v4_rcv+0x2545/0x3980 net/ipv4/tcp_ipv4.c:2052 ip_protocol_deliver_rcu+0x9f/0x7c0 net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x2ec/0x4c0 net/ipv4/ip_input.c:233 NF_HOOK include/linux/netfilter.h:302 [inline] NF_HOOK include/linux/netfilter.h:296 [inline] ip_local_deliver+0x1ae/0x200 net/ipv4/ip_input.c:254 dst_input include/net/dst.h:454 [inline] ip_rcv_finish+0x1cf/0x2f0 net/ipv4/ip_input.c:444 NF_HOOK include/linux/netfilter.h:302 [inline] NF_HOOK include/linux/netfilter.h:296 [inline] ip_rcv+0xae/0xd0 net/ipv4/ip_input.c:564 __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5482 __netif_receive_skb+0x1f/0x1c0 net/core/dev.c:5596 process_backlog+0x3e4/0x810 net/core/dev.c:5924 __napi_poll+0xb8/0x770 net/core/dev.c:6485 napi_poll net/core/dev.c:6552 [inline] net_rx_action+0xa00/0xde0 net/core/dev.c:6663 __do_softirq+0x1fb/0xadc kernel/softirq.c:571 do_softirq.part.0+0xde/0x130 kernel/softirq.c:472 do_softirq kernel/softirq.c:464 [inline] __local_bh_enable_ip+0x106/0x130 kernel/softirq.c:396 local_bh_enable include/linux/bottom_half.h:33 [inline] rcu_read_unlock_bh include/linux/rcupdate.h:820 [inline] ip_finish_output2+0x7dc/0x2180 net/ipv4/ip_output.c:229 __ip_finish_output net/ipv4/ip_output.c:306 [inline] __ip_finish_output+0x396/0x650 net/ipv4/ip_output.c:288 ip_finish_output+0x31/0x280 net/ipv4/ip_output.c:316 NF_HOOK_COND include/linux/netfilter.h:291 [inline] ip_output+0x1a3/0x320 net/ipv4/ip_output.c:430 dst_output include/net/dst.h:444 [inline] ip_local_out net/ipv4/ip_output.c:126 [inline] __ip_queue_xmit+0x8e2/0x1bf0 net/ipv4/ip_output.c:532 __tcp_transmit_skb+0x1967/0x3800 net/ipv4/tcp_output.c:1399 tcp_transmit_skb net/ipv4/tcp_output.c:1417 [inline] tcp_write_xmit+0x1025/0x6140 net/ipv4/tcp_output.c:2693 __tcp_push_pending_frames+0xae/0x390 net/ipv4/tcp_output.c:2877 tcp_push+0x49d/0x720 net/ipv4/tcp.c:729 do_tcp_sendpages+0x1ac4/0x1ea0 net/ipv4/tcp.c:1115 tcp_sendpage_locked net/ipv4/tcp.c:1141 [inline] tcp_sendpage_locked net/ipv4/tcp.c:1133 [inline] tcp_sendpage+0x84/0xd0 net/ipv4/tcp.c:1151 inet_sendpage+0xd4/0x140 net/ipv4/af_inet.c:844 kernel_sendpage.part.0+0x1d5/0x700 net/socket.c:3555 kernel_sendpage+0x86/0xd0 net/socket.c:3552 kcm_write_msgs+0x34c/0x1990 net/kcm/kcmsock.c:651 kcm_sendmsg+0x1db2/0x2370 net/kcm/kcmsock.c:1040 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xd3/0x120 net/socket.c:734 ____sys_sendmsg+0x712/0x8c0 net/socket.c:2476 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2530 __sys_sendmsg+0xf7/0x1c0 net/socket.c:2559 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd irq event stamp: 4043 hardirqs last enabled at (4043): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:151 [inline] hardirqs last enabled at (4043): [] _raw_spin_unlock_irqrestore+0x54/0x70 kernel/locking/spinlock.c:194 hardirqs last disabled at (4042): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (4042): [] _raw_spin_lock_irqsave+0x52/0x60 kernel/locking/spinlock.c:162 softirqs last enabled at (4038): [] rcu_read_unlock_bh include/linux/rcupdate.h:816 [inline] softirqs last enabled at (4038): [] l2tp_tunnel_get+0x3fb/0x750 net/l2tp/l2tp_core.c:219 softirqs last disabled at (4036): [] rcu_read_unlock include/linux/rcupdate.h:779 [inline] softirqs last disabled at (4036): [] net_generic include/net/netns/generic.h:48 [inline] softirqs last disabled at (4036): [] l2tp_pernet net/l2tp/l2tp_core.c:125 [inline] softirqs last disabled at (4036): [] l2tp_tunnel_get+0x14d/0x750 net/l2tp/l2tp_core.c:207 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(clock-AF_INET6); lock(clock-AF_INET6); *** DEADLOCK *** 1 lock held by syz-executor.0/3960: #0: ffff88807c91b130 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1721 [inline] #0: ffff88807c91b130 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: pppol2tp_connect+0xadc/0x1a10 net/l2tp/l2tp_ppp.c:675 stack backtrace: CPU: 0 PID: 3960 Comm: syz-executor.0 Not tainted 6.1.0-rc5-syzkaller-01477-g7a168f560e3c #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106 print_usage_bug kernel/locking/lockdep.c:222 [inline] valid_state kernel/locking/lockdep.c:3975 [inline] mark_lock_irq kernel/locking/lockdep.c:4184 [inline] mark_lock.part.0.cold+0x3a/0xd8 kernel/locking/lockdep.c:4634 mark_lock kernel/locking/lockdep.c:4598 [inline] mark_usage kernel/locking/lockdep.c:4547 [inline] __lock_acquire+0x893/0x56d0 kernel/locking/lockdep.c:5009 lock_acquire kernel/locking/lockdep.c:5668 [inline] lock_acquire+0x1e3/0x630 kernel/locking/lockdep.c:5633 __raw_write_lock include/linux/rwlock_api_smp.h:209 [inline] _raw_write_lock+0x2e/0x40 kernel/locking/spinlock.c:300 l2tp_tunnel_register+0x126/0x1210 net/l2tp/l2tp_core.c:1477 pppol2tp_connect+0xcdc/0x1a10 net/l2tp/l2tp_ppp.c:723 __sys_connect_file+0x153/0x1a0 net/socket.c:1976 __sys_connect+0x165/0x1a0 net/socket.c:1993 __do_sys_connect net/socket.c:2003 [inline] __se_sys_connect net/socket.c:2000 [inline] __x64_sys_connect+0x73/0xb0 net/socket.c:2000 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fb559e8c0d9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 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 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fb55ac31168 EFLAGS: 00000246 ORIG_RAX: 000000000000002a RAX: ffffffffffffffda RBX: 00007fb559fabf80 RCX: 00007fb559e8c0d9 RDX: 000000000000002e RSI: 0000000020000000 RDI: 0000000000000009 RBP: 00007fb559ee7ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffdf6e76b9f R14: 00007fb55ac31300 R15: 0000000000022000 BUG: sleeping function called from invalid context at include/linux/percpu-rwsem.h:49 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 3960, name: syz-executor.0 preempt_count: 1, expected: 0 RCU nest depth: 0, expected: 0 INFO: lockdep is turned off. Preemption disabled at: [<0000000000000000>] 0x0 CPU: 0 PID: 3960 Comm: syz-executor.0 Not tainted 6.1.0-rc5-syzkaller-01477-g7a168f560e3c #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106 __might_resched.cold+0x222/0x26b kernel/sched/core.c:9890 percpu_down_read include/linux/percpu-rwsem.h:49 [inline] cpus_read_lock+0x1b/0x140 kernel/cpu.c:310 static_key_slow_inc+0x12/0x20 kernel/jump_label.c:158 udp_tunnel_encap_enable include/net/udp_tunnel.h:187 [inline] setup_udp_tunnel_sock+0x43d/0x550 net/ipv4/udp_tunnel_core.c:81 l2tp_tunnel_register+0xc51/0x1210 net/l2tp/l2tp_core.c:1509 pppol2tp_connect+0xcdc/0x1a10 net/l2tp/l2tp_ppp.c:723 __sys_connect_file+0x153/0x1a0 net/socket.c:1976 __sys_connect+0x165/0x1a0 net/socket.c:1993 __do_sys_connect net/socket.c:2003 [inline] __se_sys_connect net/socket.c:2000 [inline] __x64_sys_connect+0x73/0xb0 net/socket.c:2000 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fb559e8c0d9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 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 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fb55ac31168 EFLAGS: 00000246 ORIG_RAX: 000000000000002a RAX: ffffffffffffffda RBX: 00007fb559fabf80 RCX: 00007fb559e8c0d9 RDX: 000000000000002e RSI: 0000000020000000 RDI: 0000000000000009 RBP: 00007fb559ee7ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffdf6e76b9f R14: 00007fb55ac31300 R15: 0000000000022000