====================================================== WARNING: possible circular locking dependency detected 5.15.153-syzkaller #0 Not tainted ------------------------------------------------------ kworker/u4:6/1834 is trying to acquire lock: ffff0000db2953b8 (&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: ffff0000c163b900 (&rm->m_rs_lock){....}-{2:2}, at: rds_send_remove_from_sock+0x134/0x7e0 net/rds/send.c:627 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+0xc4/0x14c kernel/locking/spinlock.c:162 rds_message_purge net/rds/message.c:138 [inline] rds_message_put+0x138/0xa0c net/rds/message.c:180 rds_loop_inc_free+0x20/0x30 net/rds/loop.c:115 rds_inc_put+0x100/0x198 net/rds/recv.c:82 rds_clear_recv_queue+0x1b0/0x23c net/rds/recv.c:767 rds_release+0xbc/0x2e4 net/rds/af_rds.c:73 __sock_release net/socket.c:649 [inline] sock_close+0xb8/0x1fc net/socket.c:1336 __fput+0x30c/0x7f0 fs/file_table.c:280 ____fput+0x20/0x30 fs/file_table.c:308 task_work_run+0x130/0x1e4 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] do_notify_resume+0x262c/0x32b8 arch/arm64/kernel/signal.c:946 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:133 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:138 [inline] el0_svc+0xfc/0x1f0 arch/arm64/kernel/entry-common.c:609 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 -> #0 (&rs->rs_recv_lock){....}-{2:2}: check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain kernel/locking/lockdep.c:3788 [inline] __lock_acquire+0x32d4/0x7638 kernel/locking/lockdep.c:5012 lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5623 __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:159 [inline] _raw_read_lock_irqsave+0x138/0x1e8 kernel/locking/spinlock.c:236 rds_wake_sk_sleep+0x34/0xc8 net/rds/af_rds.c:109 rds_send_remove_from_sock+0x1a4/0x7e0 net/rds/send.c:633 rds_send_path_drop_acked+0x394/0x3f4 net/rds/send.c:709 rds_tcp_write_space+0x1a8/0x5a4 net/rds/tcp_send.c:198 tcp_new_space net/ipv4/tcp_input.c:5466 [inline] tcp_check_space+0x128/0x770 net/ipv4/tcp_input.c:5485 tcp_data_snd_check net/ipv4/tcp_input.c:5494 [inline] tcp_rcv_established+0xac4/0x1f40 net/ipv4/tcp_input.c:5989 tcp_v4_do_rcv+0x340/0xc70 net/ipv4/tcp_ipv4.c:1727 sk_backlog_rcv include/net/sock.h:1059 [inline] __release_sock+0x1a8/0x408 net/core/sock.c:2724 release_sock+0x68/0x270 net/core/sock.c:3265 tcp_sock_set_cork+0x100/0x188 net/ipv4/tcp.c:3244 rds_tcp_xmit_path_complete+0x7c/0x8c net/rds/tcp_send.c:52 rds_send_xmit+0x19d8/0x23b4 net/rds/send.c:421 rds_send_worker+0x88/0x37c net/rds/threads.c:200 process_one_work+0x790/0x11b8 kernel/workqueue.c:2310 worker_thread+0x910/0x1034 kernel/workqueue.c:2457 kthread+0x37c/0x45c kernel/kthread.c:319 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 *** 5 locks held by kworker/u4:6/1834: #0: ffff0000d2501938 ((wq_completion)krdsd){+.+.}-{0:0}, at: process_one_work+0x66c/0x11b8 kernel/workqueue.c:2283 #1: ffff800021cf7c00 ((work_completion)(&(&cp->cp_send_w)->work)){+.+.}-{0:0}, at: process_one_work+0x6ac/0x11b8 kernel/workqueue.c:2285 #2: ffff0000db0bbd20 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1668 [inline] #2: ffff0000db0bbd20 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: tcp_sock_set_cork+0x38/0x188 net/ipv4/tcp.c:3242 #3: ffff0000db0bbfd8 (k-clock-AF_INET){++.-}-{2:2}, at: rds_tcp_write_space+0x38/0x5a4 net/rds/tcp_send.c:184 #4: ffff0000c163b900 (&rm->m_rs_lock){....}-{2:2}, at: rds_send_remove_from_sock+0x134/0x7e0 net/rds/send.c:627 stack backtrace: CPU: 1 PID: 1834 Comm: kworker/u4:6 Not tainted 5.15.153-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024 Workqueue: krdsd rds_send_worker Call trace: dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 dump_stack+0x1c/0x58 lib/dump_stack.c:113 print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2011 check_noncircular+0x2cc/0x378 kernel/locking/lockdep.c:2133 check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain kernel/locking/lockdep.c:3788 [inline] __lock_acquire+0x32d4/0x7638 kernel/locking/lockdep.c:5012 lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5623 __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:159 [inline] _raw_read_lock_irqsave+0x138/0x1e8 kernel/locking/spinlock.c:236 rds_wake_sk_sleep+0x34/0xc8 net/rds/af_rds.c:109 rds_send_remove_from_sock+0x1a4/0x7e0 net/rds/send.c:633 rds_send_path_drop_acked+0x394/0x3f4 net/rds/send.c:709 rds_tcp_write_space+0x1a8/0x5a4 net/rds/tcp_send.c:198 tcp_new_space net/ipv4/tcp_input.c:5466 [inline] tcp_check_space+0x128/0x770 net/ipv4/tcp_input.c:5485 tcp_data_snd_check net/ipv4/tcp_input.c:5494 [inline] tcp_rcv_established+0xac4/0x1f40 net/ipv4/tcp_input.c:5989 tcp_v4_do_rcv+0x340/0xc70 net/ipv4/tcp_ipv4.c:1727 sk_backlog_rcv include/net/sock.h:1059 [inline] __release_sock+0x1a8/0x408 net/core/sock.c:2724 release_sock+0x68/0x270 net/core/sock.c:3265 tcp_sock_set_cork+0x100/0x188 net/ipv4/tcp.c:3244 rds_tcp_xmit_path_complete+0x7c/0x8c net/rds/tcp_send.c:52 rds_send_xmit+0x19d8/0x23b4 net/rds/send.c:421 rds_send_worker+0x88/0x37c net/rds/threads.c:200 process_one_work+0x790/0x11b8 kernel/workqueue.c:2310 worker_thread+0x910/0x1034 kernel/workqueue.c:2457 kthread+0x37c/0x45c kernel/kthread.c:319 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870