====================================================== WARNING: possible circular locking dependency detected 6.3.0-rc6-syzkaller-g7920df21c1b7 #0 Not tainted ------------------------------------------------------ kworker/u4:5/1708 is trying to acquire lock: ffff0000dbbb4430 (&rs->rs_recv_lock){...-}-{2:2}, at: rds_wake_sk_sleep+0x34/0xc8 net/rds/af_rds.c:109 but task is already holding lock: ffff0000da5ce100 (&rm->m_rs_lock){..-.}-{2:2}, at: rds_send_remove_from_sock+0x134/0x78c net/rds/send.c:628 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&rm->m_rs_lock){..-.}-{2:2}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x68/0x88 kernel/locking/spinlock.c:162 rds_message_purge net/rds/message.c:138 [inline] rds_message_put+0x130/0xb30 net/rds/message.c:180 rds_loop_inc_free+0x20/0x30 net/rds/loop.c:115 rds_inc_put net/rds/recv.c:83 [inline] rds_clear_recv_queue+0x288/0x384 net/rds/recv.c:768 rds_release+0xbc/0x2d0 net/rds/af_rds.c:73 __sock_release net/socket.c:653 [inline] sock_close+0xb8/0x1fc net/socket.c:1395 __fput+0x30c/0x7bc fs/file_table.c:321 ____fput+0x20/0x30 fs/file_table.c:349 task_work_run+0x230/0x2e0 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] do_notify_resume+0x2180/0x3c90 arch/arm64/kernel/signal.c:1302 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/0x168 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:591 -> #0 (&rs->rs_recv_lock){...-}-{2:2}: check_prev_add kernel/locking/lockdep.c:3098 [inline] check_prevs_add kernel/locking/lockdep.c:3217 [inline] validate_chain kernel/locking/lockdep.c:3832 [inline] __lock_acquire+0x3338/0x764c kernel/locking/lockdep.c:5056 lock_acquire+0x238/0x718 kernel/locking/lockdep.c:5669 __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline] _raw_read_lock_irqsave+0x78/0x98 kernel/locking/spinlock.c:236 rds_wake_sk_sleep+0x34/0xc8 net/rds/af_rds.c:109 rds_send_remove_from_sock+0x1a4/0x78c net/rds/send.c:634 rds_send_path_drop_acked+0x390/0x3f0 net/rds/send.c:710 rds_tcp_write_space+0x1a8/0x594 net/rds/tcp_send.c:198 tcp_new_space net/ipv4/tcp_input.c:5483 [inline] tcp_check_space+0x150/0x888 net/ipv4/tcp_input.c:5502 tcp_data_snd_check net/ipv4/tcp_input.c:5511 [inline] tcp_rcv_established+0xdc0/0x1ee0 net/ipv4/tcp_input.c:6019 tcp_v4_do_rcv+0x388/0xd8c net/ipv4/tcp_ipv4.c:1721 tcp_v4_rcv+0x1f90/0x28dc net/ipv4/tcp_ipv4.c:2143 ip_protocol_deliver_rcu+0x504/0xc8c net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x23c/0x46c net/ipv4/ip_input.c:233 NF_HOOK+0x328/0x3d4 include/linux/netfilter.h:302 ip_local_deliver+0x11c/0x190 net/ipv4/ip_input.c:254 dst_input include/net/dst.h:454 [inline] ip_rcv_finish+0x224/0x250 net/ipv4/ip_input.c:449 NF_HOOK+0x328/0x3d4 include/linux/netfilter.h:302 ip_rcv+0x78/0x98 net/ipv4/ip_input.c:569 __netif_receive_skb_one_core net/core/dev.c:5479 [inline] __netif_receive_skb+0x18c/0x400 net/core/dev.c:5593 process_backlog+0x3c0/0x70c net/core/dev.c:5921 __napi_poll+0xb4/0x648 net/core/dev.c:6482 napi_poll net/core/dev.c:6549 [inline] net_rx_action+0x5a8/0xc8c net/core/dev.c:6659 __do_softirq+0x2dc/0xd60 kernel/softirq.c:571 ____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:80 call_on_irq_stack+0x24/0x4c arch/arm64/kernel/entry.S:899 do_softirq_own_stack+0x20/0x2c arch/arm64/kernel/irq.c:85 do_softirq+0x11c/0x1d8 kernel/softirq.c:472 __local_bh_enable_ip+0x2b0/0x4ac kernel/softirq.c:396 local_bh_enable+0x28/0x1b0 include/linux/bottom_half.h:33 rcu_read_unlock_bh include/linux/rcupdate.h:843 [inline] ip_finish_output2+0xd2c/0x11a0 net/ipv4/ip_output.c:229 __ip_finish_output+0x1b0/0x458 ip_finish_output+0x40/0x268 net/ipv4/ip_output.c:316 NF_HOOK_COND include/linux/netfilter.h:291 [inline] ip_output+0x330/0x49c 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+0xe8c/0x1a00 net/ipv4/ip_output.c:532 ip_queue_xmit+0x5c/0x78 net/ipv4/ip_output.c:546 __tcp_transmit_skb+0x1938/0x31fc net/ipv4/tcp_output.c:1399 __tcp_send_ack+0x248/0x51c net/ipv4/tcp_output.c:3983 tcp_send_ack+0x4c/0x64 net/ipv4/tcp_output.c:3989 __tcp_ack_snd_check+0x3b4/0x8d8 net/ipv4/tcp_input.c:5536 tcp_ack_snd_check net/ipv4/tcp_input.c:5582 [inline] tcp_rcv_established+0xdfc/0x1ee0 net/ipv4/tcp_input.c:6020 tcp_v4_do_rcv+0x388/0xd8c net/ipv4/tcp_ipv4.c:1721 sk_backlog_rcv include/net/sock.h:1113 [inline] __release_sock+0x1a8/0x408 net/core/sock.c:2922 release_sock+0x68/0x1cc net/core/sock.c:3489 rds_tcp_tune+0x438/0x630 rds_tcp_accept_one+0x2c0/0x990 net/rds/tcp_listen.c:137 rds_tcp_accept_worker+0x44/0xb4 net/rds/tcp.c:532 process_one_work+0x788/0x12d4 kernel/workqueue.c:2390 worker_thread+0x8e0/0xfe8 kernel/workqueue.c:2537 kthread+0x24c/0x2d4 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&rm->m_rs_lock); lock(&rs->rs_recv_lock); lock(&rm->m_rs_lock); lock(&rs->rs_recv_lock); *** DEADLOCK *** 9 locks held by kworker/u4:5/1708: #0: ffff0000d3449938 ((wq_completion)krdsd){+.+.}-{0:0}, at: process_one_work+0x664/0x12d4 kernel/workqueue.c:2363 #1: ffff800023017c20 ((work_completion)(&rtn->rds_tcp_accept_w)){+.+.}-{0:0}, at: process_one_work+0x6a8/0x12d4 kernel/workqueue.c:2365 #2: ffff0000d3482770 (k-sk_lock-AF_INET6){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1697 [inline] #2: ffff0000d3482770 (k-sk_lock-AF_INET6){+.+.}-{0:0}, at: rds_tcp_tune+0xc4/0x630 net/rds/tcp.c:497 #3: ffff800015e4ef00 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x18/0x54 include/linux/rcupdate.h:326 #4: ffff800015e4ef00 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x18/0x54 include/linux/rcupdate.h:326 #5: ffff800015e4ef00 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x10/0x4c include/linux/rcupdate.h:326 #6: ffff0000ce319930 (k-slock-AF_INET/1){+.-.}-{2:2}, at: tcp_v4_rcv+0x1f4c/0x28dc net/ipv4/tcp_ipv4.c:2139 #7: ffff0000ce319c38 (k-clock-AF_INET){++.-}-{2:2}, at: rds_tcp_write_space+0x38/0x594 net/rds/tcp_send.c:184 #8: ffff0000da5ce100 (&rm->m_rs_lock){..-.}-{2:2}, at: rds_send_remove_from_sock+0x134/0x78c net/rds/send.c:628 stack backtrace: CPU: 0 PID: 1708 Comm: kworker/u4:5 Not tainted 6.3.0-rc6-syzkaller-g7920df21c1b7 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023 Workqueue: krdsd rds_tcp_accept_worker Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:233 show_stack+0x2c/0x44 arch/arm64/kernel/stacktrace.c:240 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd0/0x124 lib/dump_stack.c:106 dump_stack+0x1c/0x28 lib/dump_stack.c:113 print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2056 check_noncircular+0x2cc/0x378 kernel/locking/lockdep.c:2178 check_prev_add kernel/locking/lockdep.c:3098 [inline] check_prevs_add kernel/locking/lockdep.c:3217 [inline] validate_chain kernel/locking/lockdep.c:3832 [inline] __lock_acquire+0x3338/0x764c kernel/locking/lockdep.c:5056 lock_acquire+0x238/0x718 kernel/locking/lockdep.c:5669 __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline] _raw_read_lock_irqsave+0x78/0x98 kernel/locking/spinlock.c:236 rds_wake_sk_sleep+0x34/0xc8 net/rds/af_rds.c:109 rds_send_remove_from_sock+0x1a4/0x78c net/rds/send.c:634 rds_send_path_drop_acked+0x390/0x3f0 net/rds/send.c:710 rds_tcp_write_space+0x1a8/0x594 net/rds/tcp_send.c:198 tcp_new_space net/ipv4/tcp_input.c:5483 [inline] tcp_check_space+0x150/0x888 net/ipv4/tcp_input.c:5502 tcp_data_snd_check net/ipv4/tcp_input.c:5511 [inline] tcp_rcv_established+0xdc0/0x1ee0 net/ipv4/tcp_input.c:6019 tcp_v4_do_rcv+0x388/0xd8c net/ipv4/tcp_ipv4.c:1721 tcp_v4_rcv+0x1f90/0x28dc net/ipv4/tcp_ipv4.c:2143 ip_protocol_deliver_rcu+0x504/0xc8c net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x23c/0x46c net/ipv4/ip_input.c:233 NF_HOOK+0x328/0x3d4 include/linux/netfilter.h:302 ip_local_deliver+0x11c/0x190 net/ipv4/ip_input.c:254 dst_input include/net/dst.h:454 [inline] ip_rcv_finish+0x224/0x250 net/ipv4/ip_input.c:449 NF_HOOK+0x328/0x3d4 include/linux/netfilter.h:302 ip_rcv+0x78/0x98 net/ipv4/ip_input.c:569 __netif_receive_skb_one_core net/core/dev.c:5479 [inline] __netif_receive_skb+0x18c/0x400 net/core/dev.c:5593 process_backlog+0x3c0/0x70c net/core/dev.c:5921 __napi_poll+0xb4/0x648 net/core/dev.c:6482 napi_poll net/core/dev.c:6549 [inline] net_rx_action+0x5a8/0xc8c net/core/dev.c:6659 __do_softirq+0x2dc/0xd60 kernel/softirq.c:571 ____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:80 call_on_irq_stack+0x24/0x4c arch/arm64/kernel/entry.S:899 do_softirq_own_stack+0x20/0x2c arch/arm64/kernel/irq.c:85 do_softirq+0x11c/0x1d8 kernel/softirq.c:472 __local_bh_enable_ip+0x2b0/0x4ac kernel/softirq.c:396 local_bh_enable+0x28/0x1b0 include/linux/bottom_half.h:33 rcu_read_unlock_bh include/linux/rcupdate.h:843 [inline] ip_finish_output2+0xd2c/0x11a0 net/ipv4/ip_output.c:229 __ip_finish_output+0x1b0/0x458 ip_finish_output+0x40/0x268 net/ipv4/ip_output.c:316 NF_HOOK_COND include/linux/netfilter.h:291 [inline] ip_output+0x330/0x49c 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+0xe8c/0x1a00 net/ipv4/ip_output.c:532 ip_queue_xmit+0x5c/0x78 net/ipv4/ip_output.c:546 __tcp_transmit_skb+0x1938/0x31fc net/ipv4/tcp_output.c:1399 __tcp_send_ack+0x248/0x51c net/ipv4/tcp_output.c:3983 tcp_send_ack+0x4c/0x64 net/ipv4/tcp_output.c:3989 __tcp_ack_snd_check+0x3b4/0x8d8 net/ipv4/tcp_input.c:5536 tcp_ack_snd_check net/ipv4/tcp_input.c:5582 [inline] tcp_rcv_established+0xdfc/0x1ee0 net/ipv4/tcp_input.c:6020 tcp_v4_do_rcv+0x388/0xd8c net/ipv4/tcp_ipv4.c:1721 sk_backlog_rcv include/net/sock.h:1113 [inline] __release_sock+0x1a8/0x408 net/core/sock.c:2922 release_sock+0x68/0x1cc net/core/sock.c:3489 rds_tcp_tune+0x438/0x630 rds_tcp_accept_one+0x2c0/0x990 net/rds/tcp_listen.c:137 rds_tcp_accept_worker+0x44/0xb4 net/rds/tcp.c:532 process_one_work+0x788/0x12d4 kernel/workqueue.c:2390 worker_thread+0x8e0/0xfe8 kernel/workqueue.c:2537 kthread+0x24c/0x2d4 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870