====================================================== WARNING: possible circular locking dependency detected 6.6.0-rc3-syzkaller-00096-g71e58659bfc0 #0 Not tainted ------------------------------------------------------ syz-executor426/5480 is trying to acquire lock: ffff88807a2ea530 (&rs->rs_recv_lock){...-}-{2:2}, at: rds_wake_sk_sleep+0x2e/0xd0 net/rds/af_rds.c:109 but task is already holding lock: ffff888077fd5100 (&rm->m_rs_lock){..-.}-{2:2}, at: rds_send_remove_from_sock+0x129/0x800 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+0xd5/0x120 kernel/locking/spinlock.c:162 rds_message_purge net/rds/message.c:138 [inline] rds_message_put+0x14a/0xaa0 net/rds/message.c:180 rds_inc_put net/rds/recv.c:83 [inline] rds_clear_recv_queue+0x2e2/0x3b0 net/rds/recv.c:768 rds_release+0xc5/0x2e0 net/rds/af_rds.c:73 __sock_release net/socket.c:659 [inline] sock_close+0xb8/0x230 net/socket.c:1402 __fput+0x3f8/0x910 fs/file_table.c:384 task_work_run+0x24a/0x300 kernel/task_work.c:180 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xa2c/0x2650 kernel/exit.c:874 do_group_exit+0x206/0x2c0 kernel/exit.c:1024 __do_sys_exit_group kernel/exit.c:1035 [inline] __se_sys_exit_group kernel/exit.c:1033 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1033 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (&rs->rs_recv_lock){...-}-{2:2}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3868 [inline] __lock_acquire+0x39ff/0x7f70 kernel/locking/lockdep.c:5136 lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5753 __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline] _raw_read_lock_irqsave+0xdd/0x120 kernel/locking/spinlock.c:236 rds_wake_sk_sleep+0x2e/0xd0 net/rds/af_rds.c:109 rds_send_remove_from_sock+0x1c9/0x800 net/rds/send.c:634 rds_send_path_drop_acked+0x366/0x3b0 net/rds/send.c:710 rds_tcp_write_space+0x198/0x5d0 net/rds/tcp_send.c:199 tcp_new_space net/ipv4/tcp_input.c:5504 [inline] tcp_check_space+0x17a/0xab0 net/ipv4/tcp_input.c:5523 tcp_data_snd_check net/ipv4/tcp_input.c:5532 [inline] tcp_rcv_established+0xb32/0x1f80 net/ipv4/tcp_input.c:6042 tcp_v4_do_rcv+0x6bd/0xb50 net/ipv4/tcp_ipv4.c:1728 sk_backlog_rcv include/net/sock.h:1121 [inline] __release_sock+0x19c/0x4b0 net/core/sock.c:2983 release_sock+0x61/0x1c0 net/core/sock.c:3520 rds_send_xmit+0x1d1a/0x2580 net/rds/send.c:422 rds_sendmsg+0x1b99/0x2270 net/rds/send.c:1381 sock_sendmsg_nosec net/socket.c:730 [inline] sock_sendmsg net/socket.c:753 [inline] ____sys_sendmsg+0x592/0x890 net/socket.c:2541 ___sys_sendmsg net/socket.c:2595 [inline] __sys_sendmsg+0x2b0/0x3a0 net/socket.c:2624 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 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); rlock(&rs->rs_recv_lock); *** DEADLOCK *** 3 locks held by syz-executor426/5480: #0: ffff888029a96f70 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1722 [inline] #0: ffff888029a96f70 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: tcp_sock_set_cork+0x2d/0x1b0 net/ipv4/tcp.c:3233 #1: ffff888029a971f8 (k-clock-AF_INET){++.-}-{2:2}, at: rds_tcp_write_space+0x33/0x5d0 net/rds/tcp_send.c:185 #2: ffff888077fd5100 (&rm->m_rs_lock){..-.}-{2:2}, at: rds_send_remove_from_sock+0x129/0x800 net/rds/send.c:628 stack backtrace: CPU: 0 PID: 5480 Comm: syz-executor426 Not tainted 6.6.0-rc3-syzkaller-00096-g71e58659bfc0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 check_noncircular+0x375/0x4a0 kernel/locking/lockdep.c:2187 check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3868 [inline] __lock_acquire+0x39ff/0x7f70 kernel/locking/lockdep.c:5136 lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5753 __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline] _raw_read_lock_irqsave+0xdd/0x120 kernel/locking/spinlock.c:236 rds_wake_sk_sleep+0x2e/0xd0 net/rds/af_rds.c:109 rds_send_remove_from_sock+0x1c9/0x800 net/rds/send.c:634 rds_send_path_drop_acked+0x366/0x3b0 net/rds/send.c:710 rds_tcp_write_space+0x198/0x5d0 net/rds/tcp_send.c:199 tcp_new_space net/ipv4/tcp_input.c:5504 [inline] tcp_check_space+0x17a/0xab0 net/ipv4/tcp_input.c:5523 tcp_data_snd_check net/ipv4/tcp_input.c:5532 [inline] tcp_rcv_established+0xb32/0x1f80 net/ipv4/tcp_input.c:6042 tcp_v4_do_rcv+0x6bd/0xb50 net/ipv4/tcp_ipv4.c:1728 sk_backlog_rcv include/net/sock.h:1121 [inline] __release_sock+0x19c/0x4b0 net/core/sock.c:2983 release_sock+0x61/0x1c0 net/core/sock.c:3520 rds_send_xmit+0x1d1a/0x2580 net/rds/send.c:422 rds_sendmsg+0x1b99/0x2270 net/rds/send.c:1381 sock_sendmsg_nosec net/socket.c:730 [inline] sock_sendmsg net/socket.c:753 [inline] ____sys_sendmsg+0x592/0x890 net/socket.c:2541 ___sys_sendmsg net/socket.c:2595 [inline] __sys_sendmsg+0x2b0/0x3a0 net/socket.c:2624 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fb3f7eac6e9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 51 18 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fb3f7e2b228 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007fb3f7f36368 RCX: 00007fb3f7eac6e9 RDX: 0000000000000000 RSI: 00000000200000c0 RDI: 0000000000000004 RBP: 00007fb3f7f36360 R08: 00007fff41c956a7 R09: 00007fb3f7e2b6c0 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fb3f7f3636c R13: 00007fb3f7f03064 R14: 0000040000000015 R15: 00007fff41c956a8