======================================================== WARNING: possible irq lock inversion dependency detected 6.1.0-rc6-syzkaller-32653-g65762d97e6fa #0 Not tainted -------------------------------------------------------- syz-executor197/3087 just changed the state of lock: ffff0000cb84fbb8 (clock-AF_INET6){+++.}-{2:2}, at: l2tp_tunnel_register+0x354/0x79c net/l2tp/l2tp_core.c:1477 but this lock was taken by another, SOFTIRQ-safe lock in the past: (&tcp_hashinfo.bhash[i].lock){+.-.}-{2:2} and interrupts could create inverse lock ordering between them. other info that might help us debug this: Possible interrupt unsafe locking scenario: CPU0 CPU1 ---- ---- lock(clock-AF_INET6); local_irq_disable(); lock(&tcp_hashinfo.bhash[i].lock); lock(clock-AF_INET6); lock(&tcp_hashinfo.bhash[i].lock); *** DEADLOCK *** 1 lock held by syz-executor197/3087: #0: ffff0000cb7e9130 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1721 [inline] #0: ffff0000cb7e9130 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: pppol2tp_connect+0x184/0x6c4 net/l2tp/l2tp_ppp.c:675 the shortest dependencies between 2nd lock and 1st lock: -> (&tcp_hashinfo.bhash[i].lock){+.-.}-{2:2} { HARDIRQ-ON-W at: lock_acquire+0x100/0x1f8 kernel/locking/lockdep.c:5668 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline] _raw_spin_lock_bh+0x54/0x6c kernel/locking/spinlock.c:178 spin_lock_bh include/linux/spinlock.h:355 [inline] inet_csk_get_port+0xe0/0xaf0 net/ipv4/inet_connection_sock.c:496 __inet6_bind+0x688/0x8ac net/ipv6/af_inet6.c:412 inet6_bind+0xf4/0x150 net/ipv6/af_inet6.c:471 rds_tcp_listen_init+0x14c/0x1f0 net/rds/tcp_listen.c:307 rds_tcp_init_net+0xcc/0x1dc net/rds/tcp.c:573 ops_init+0xe4/0x2e4 net/core/net_namespace.c:135 __register_pernet_operations net/core/net_namespace.c:1153 [inline] register_pernet_operations+0x108/0x264 net/core/net_namespace.c:1222 register_pernet_device+0x3c/0x94 net/core/net_namespace.c:1309 rds_tcp_init+0x74/0xe0 net/rds/tcp.c:731 do_one_initcall+0x118/0x22c init/main.c:1303 do_initcall_level+0xac/0xe4 init/main.c:1376 do_initcalls+0x58/0xa8 init/main.c:1392 do_basic_setup+0x20/0x2c init/main.c:1411 kernel_init_freeable+0xb8/0x148 init/main.c:1631 kernel_init+0x24/0x290 init/main.c:1519 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:863 IN-SOFTIRQ-W at: lock_acquire+0x100/0x1f8 kernel/locking/lockdep.c:5668 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x54/0x6c kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:350 [inline] __inet_inherit_port+0x124/0x9ac net/ipv4/inet_hashtables.c:229 tcp_v4_syn_recv_sock+0x790/0x848 net/ipv4/tcp_ipv4.c:1588 tcp_check_req+0x75c/0x8e4 net/ipv4/tcp_minisocks.c:786 tcp_v4_rcv+0xad4/0x11e8 net/ipv4/tcp_ipv4.c:2030 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_sublist_rcv_finish net/ipv4/ip_input.c:575 [inline] ip_list_rcv_finish net/ipv4/ip_input.c:625 [inline] ip_sublist_rcv+0x40c/0x474 net/ipv4/ip_input.c:633 ip_list_rcv+0x184/0x1c8 net/ipv4/ip_input.c:668 __netif_receive_skb_list_ptype net/core/dev.c:5532 [inline] __netif_receive_skb_list_core+0x1f8/0x2b0 net/core/dev.c:5580 __netif_receive_skb_list+0x16c/0x1d0 net/core/dev.c:5632 netif_receive_skb_list_internal+0x1e8/0x340 net/core/dev.c:5723 gro_normal_list include/net/gro.h:433 [inline] napi_complete_done+0x140/0x354 net/core/dev.c:6064 gve_napi_poll+0xcc/0x1b4 drivers/net/ethernet/google/gve/gve_main.c:214 __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 invoke_softirq+0x70/0xbc kernel/softirq.c:452 __irq_exit_rcu+0xf0/0x140 kernel/softirq.c:650 irq_exit_rcu+0x10/0x40 kernel/softirq.c:662 __el1_irq arch/arm64/kernel/entry-common.c:472 [inline] el1_interrupt+0x38/0x68 arch/arm64/kernel/entry-common.c:486 el1h_64_irq_handler+0x18/0x24 arch/arm64/kernel/entry-common.c:491 el1h_64_irq+0x64/0x68 arch/arm64/kernel/entry.S:580 arch_local_irq_enable+0xc/0x18 arch/arm64/include/asm/irqflags.h:35 default_idle_call+0x48/0xb8 kernel/sched/idle.c:109 cpuidle_idle_call kernel/sched/idle.c:191 [inline] do_idle+0x110/0x2d4 kernel/sched/idle.c:303 cpu_startup_entry+0x24/0x28 kernel/sched/idle.c:400 kernel_init+0x0/0x290 init/main.c:729 start_kernel+0x0/0x620 init/main.c:890 start_kernel+0x450/0x620 init/main.c:1145 __primary_switched+0xb4/0xbc arch/arm64/kernel/head.S:471 INITIAL USE at: lock_acquire+0x100/0x1f8 kernel/locking/lockdep.c:5668 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline] _raw_spin_lock_bh+0x54/0x6c kernel/locking/spinlock.c:178 spin_lock_bh include/linux/spinlock.h:355 [inline] inet_csk_get_port+0xe0/0xaf0 net/ipv4/inet_connection_sock.c:496 __inet6_bind+0x688/0x8ac net/ipv6/af_inet6.c:412 inet6_bind+0xf4/0x150 net/ipv6/af_inet6.c:471 rds_tcp_listen_init+0x14c/0x1f0 net/rds/tcp_listen.c:307 rds_tcp_init_net+0xcc/0x1dc net/rds/tcp.c:573 ops_init+0xe4/0x2e4 net/core/net_namespace.c:135 __register_pernet_operations net/core/net_namespace.c:1153 [inline] register_pernet_operations+0x108/0x264 net/core/net_namespace.c:1222 register_pernet_device+0x3c/0x94 net/core/net_namespace.c:1309 rds_tcp_init+0x74/0xe0 net/rds/tcp.c:731 do_one_initcall+0x118/0x22c init/main.c:1303 do_initcall_level+0xac/0xe4 init/main.c:1376 do_initcalls+0x58/0xa8 init/main.c:1392 do_basic_setup+0x20/0x2c init/main.c:1411 kernel_init_freeable+0xb8/0x148 init/main.c:1631 kernel_init+0x24/0x290 init/main.c:1519 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:863 } ... key at: [] tcp_init.__key.22+0x0/0x10 ... acquired at: __raw_read_lock_bh include/linux/rwlock_api_smp.h:176 [inline] _raw_read_lock_bh+0x64/0x7c kernel/locking/spinlock.c:252 sock_i_uid+0x24/0x58 net/core/sock.c:2542 sk_reuseport_match net/ipv4/inet_connection_sock.c:383 [inline] inet_csk_get_port+0x674/0xaf0 net/ipv4/inet_connection_sock.c:514 __inet6_bind+0x688/0x8ac net/ipv6/af_inet6.c:412 inet6_bind+0xf4/0x150 net/ipv6/af_inet6.c:471 __sys_bind+0x148/0x1b0 net/socket.c:1776 __do_sys_bind net/socket.c:1787 [inline] __se_sys_bind net/socket.c:1785 [inline] __arm64_sys_bind+0x28/0x3c net/socket.c:1785 __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 -> (clock-AF_INET6){+++.}-{2:2} { HARDIRQ-ON-W at: lock_acquire+0x100/0x1f8 kernel/locking/lockdep.c:5668 __raw_write_lock_bh include/linux/rwlock_api_smp.h:202 [inline] _raw_write_lock_bh+0x54/0x6c kernel/locking/spinlock.c:334 sock_orphan include/net/sock.h:2090 [inline] sk_common_release+0x58/0x1d4 net/core/sock.c:3672 udp_lib_close+0x20/0x30 include/net/udp.h:189 inet_release+0xc8/0xe4 net/ipv4/af_inet.c:428 inet6_release+0x3c/0x58 net/ipv6/af_inet6.c:488 __sock_release net/socket.c:650 [inline] sock_close+0x50/0xf0 net/socket.c:1365 __fput+0x198/0x3e4 fs/file_table.c:320 ____fput+0x20/0x30 fs/file_table.c:348 task_work_run+0x100/0x148 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] do_notify_resume+0x174/0x1f0 arch/arm64/kernel/signal.c:1127 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline] el0_svc+0x9c/0x150 arch/arm64/kernel/entry-common.c:638 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:584 HARDIRQ-ON-R 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 sock_i_uid+0x24/0x58 net/core/sock.c:2542 udp_lib_lport_inuse+0x44/0x268 net/ipv4/udp.c:140 udp_lib_get_port+0x2bc/0x8f8 net/ipv4/udp.c:306 udp_v6_get_port+0x60/0x74 net/ipv6/udp.c:105 __inet6_bind+0x688/0x8ac net/ipv6/af_inet6.c:412 inet6_bind+0xf4/0x150 net/ipv6/af_inet6.c:471 __sys_bind+0x148/0x1b0 net/socket.c:1776 __do_sys_bind net/socket.c:1787 [inline] __se_sys_bind net/socket.c:1785 [inline] __arm64_sys_bind+0x28/0x3c net/socket.c:1785 __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 SOFTIRQ-ON-W at: 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 pppol2tp_connect+0x3e8/0x6c4 net/l2tp/l2tp_ppp.c:723 __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 INITIAL USE at: lock_acquire+0x100/0x1f8 kernel/locking/lockdep.c:5668 __raw_write_lock_bh include/linux/rwlock_api_smp.h:202 [inline] _raw_write_lock_bh+0x54/0x6c kernel/locking/spinlock.c:334 sock_orphan include/net/sock.h:2090 [inline] sk_common_release+0x58/0x1d4 net/core/sock.c:3672 udp_lib_close+0x20/0x30 include/net/udp.h:189 inet_release+0xc8/0xe4 net/ipv4/af_inet.c:428 inet6_release+0x3c/0x58 net/ipv6/af_inet6.c:488 __sock_release net/socket.c:650 [inline] sock_close+0x50/0xf0 net/socket.c:1365 __fput+0x198/0x3e4 fs/file_table.c:320 ____fput+0x20/0x30 fs/file_table.c:348 task_work_run+0x100/0x148 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] do_notify_resume+0x174/0x1f0 arch/arm64/kernel/signal.c:1127 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline] el0_svc+0x9c/0x150 arch/arm64/kernel/entry-common.c:638 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:584 INITIAL READ USE 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 sock_i_uid+0x24/0x58 net/core/sock.c:2542 udp_lib_lport_inuse+0x44/0x268 net/ipv4/udp.c:140 udp_lib_get_port+0x2bc/0x8f8 net/ipv4/udp.c:306 udp_v6_get_port+0x60/0x74 net/ipv6/udp.c:105 __inet6_bind+0x688/0x8ac net/ipv6/af_inet6.c:412 inet6_bind+0xf4/0x150 net/ipv6/af_inet6.c:471 __sys_bind+0x148/0x1b0 net/socket.c:1776 __do_sys_bind net/socket.c:1787 [inline] __se_sys_bind net/socket.c:1785 [inline] __arm64_sys_bind+0x28/0x3c net/socket.c:1785 __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 } ... key at: [] af_callback_keys+0xa0/0x2e0 ... acquired at: 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 pppol2tp_connect+0x3e8/0x6c4 net/l2tp/l2tp_ppp.c:723 __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 stack backtrace: CPU: 0 PID: 3087 Comm: syz-executor197 Not tainted 6.1.0-rc6-syzkaller-32653-g65762d97e6fa #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_irq_inversion_bug+0x2f8/0x300 kernel/locking/lockdep.c:4042 mark_lock_irq+0x3ec/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 pppol2tp_connect+0x3e8/0x6c4 net/l2tp/l2tp_ppp.c:723 __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 BUG: sleeping function called from invalid context at include/linux/percpu-rwsem.h:49 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 3087, name: syz-executor197 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: 0 PID: 3087 Comm: syz-executor197 Not tainted 6.1.0-rc6-syzkaller-32653-g65762d97e6fa #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 pppol2tp_connect+0x3e8/0x6c4 net/l2tp/l2tp_ppp.c:723 __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