====================================================== WARNING: possible circular locking dependency detected 6.1.0-rc7-syzkaller-00200-gc2bf05db6c78 #0 Not tainted ------------------------------------------------------ syz-executor983/6031 is trying to acquire lock: ffff888075176af0 (&rs->rs_recv_lock){....}-{2:2}, at: rds_wake_sk_sleep+0x2a/0xd0 net/rds/af_rds.c:109 but task is already holding lock: ffff888076810900 (&rm->m_rs_lock){....}-{2:2}, at: rds_send_remove_from_sock+0x14b/0x8c0 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}: lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5668 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162 rds_message_purge net/rds/message.c:138 [inline] rds_message_put+0x13c/0xab0 net/rds/message.c:180 rds_inc_put net/rds/recv.c:82 [inline] rds_clear_recv_queue+0x2be/0x390 net/rds/recv.c:767 rds_release+0xbe/0x2d0 net/rds/af_rds.c:73 __sock_release net/socket.c:650 [inline] sock_close+0xd7/0x260 net/socket.c:1365 __fput+0x3ba/0x880 fs/file_table.c:320 task_work_run+0x243/0x300 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0x134/0x160 kernel/entry/common.c:171 exit_to_user_mode_prepare+0xad/0x110 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x2e/0x60 kernel/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (&rs->rs_recv_lock){....}-{2:2}: check_prev_add kernel/locking/lockdep.c:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain+0x184a/0x6470 kernel/locking/lockdep.c:3831 __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5055 lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5668 __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline] _raw_read_lock_irqsave+0xd9/0x120 kernel/locking/spinlock.c:236 rds_wake_sk_sleep+0x2a/0xd0 net/rds/af_rds.c:109 rds_send_remove_from_sock+0x1fd/0x8c0 net/rds/send.c:634 rds_send_path_drop_acked+0x380/0x3c0 net/rds/send.c:710 rds_tcp_write_space+0x192/0x520 net/rds/tcp_send.c:198 tcp_new_space net/ipv4/tcp_input.c:5471 [inline] tcp_check_space+0x35d/0x4f0 net/ipv4/tcp_input.c:5490 tcp_data_snd_check net/ipv4/tcp_input.c:5499 [inline] tcp_rcv_established+0xa72/0x1a10 net/ipv4/tcp_input.c:6007 tcp_v4_do_rcv+0x479/0xac0 net/ipv4/tcp_ipv4.c:1670 sk_backlog_rcv include/net/sock.h:1109 [inline] __release_sock+0x1d8/0x4c0 net/core/sock.c:2906 release_sock+0x5d/0x1c0 net/core/sock.c:3462 rds_send_xmit+0x1e5d/0x2690 net/rds/send.c:422 rds_sendmsg+0x1bdf/0x2290 net/rds/send.c:1382 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg net/socket.c:734 [inline] __sys_sendto+0x46d/0x5f0 net/socket.c:2117 __do_sys_sendto net/socket.c:2129 [inline] __se_sys_sendto net/socket.c:2125 [inline] __x64_sys_sendto+0xda/0xf0 net/socket.c:2125 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd 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 *** 3 locks held by syz-executor983/6031: #0: ffff88807b053d30 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1721 [inline] #0: ffff88807b053d30 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: tcp_sock_set_cork+0x29/0x1b0 net/ipv4/tcp.c:3338 #1: ffff88807b053fb8 (k-clock-AF_INET){++.-}-{2:2}, at: rds_tcp_write_space+0x30/0x520 net/rds/tcp_send.c:184 #2: ffff888076810900 (&rm->m_rs_lock){....}-{2:2}, at: rds_send_remove_from_sock+0x14b/0x8c0 net/rds/send.c:628 stack backtrace: CPU: 0 PID: 6031 Comm: syz-executor983 Not tainted 6.1.0-rc7-syzkaller-00200-gc2bf05db6c78 #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+0x1e3/0x2cb lib/dump_stack.c:106 check_noncircular+0x2f9/0x3b0 kernel/locking/lockdep.c:2177 check_prev_add kernel/locking/lockdep.c:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain+0x184a/0x6470 kernel/locking/lockdep.c:3831 __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5055 lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5668 __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline] _raw_read_lock_irqsave+0xd9/0x120 kernel/locking/spinlock.c:236 rds_wake_sk_sleep+0x2a/0xd0 net/rds/af_rds.c:109 rds_send_remove_from_sock+0x1fd/0x8c0 net/rds/send.c:634 rds_send_path_drop_acked+0x380/0x3c0 net/rds/send.c:710 rds_tcp_write_space+0x192/0x520 net/rds/tcp_send.c:198 tcp_new_space net/ipv4/tcp_input.c:5471 [inline] tcp_check_space+0x35d/0x4f0 net/ipv4/tcp_input.c:5490 tcp_data_snd_check net/ipv4/tcp_input.c:5499 [inline] tcp_rcv_established+0xa72/0x1a10 net/ipv4/tcp_input.c:6007 tcp_v4_do_rcv+0x479/0xac0 net/ipv4/tcp_ipv4.c:1670 sk_backlog_rcv include/net/sock.h:1109 [inline] __release_sock+0x1d8/0x4c0 net/core/sock.c:2906 release_sock+0x5d/0x1c0 net/core/sock.c:3462 rds_send_xmit+0x1e5d/0x2690 net/rds/send.c:422 rds_sendmsg+0x1bdf/0x2290 net/rds/send.c:1382 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg net/socket.c:734 [inline] __sys_sendto+0x46d/0x5f0 net/socket.c:2117 __do_sys_sendto net/socket.c:2129 [inline] __se_sys_sendto net/socket.c:2125 [inline] __x64_sys_sendto+0xda/0xf0 net/socket.c:2125 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f0010e30129 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 15 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:00007f0010ddd308 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 00007f0010eb94c8 RCX: 00007f0010e30129 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000004 RBP: 00007f0010eb94c0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f0010e865c8 R13: 00007ffe6b3ac31f R14: 00007f0010ddd400 R15: 0000000000022000