====================================================== WARNING: possible circular locking dependency detected 5.19.0-rc3-syzkaller-00336-g0840a7914caa #0 Not tainted ------------------------------------------------------ syz-executor266/4295 is trying to acquire lock: ffff888024f61de0 (&rs->rs_recv_lock){....}-{2:2}, at: rds_wake_sk_sleep+0x1f/0xe0 net/rds/af_rds.c:109 but task is already holding lock: ffff88801ff73900 (&rm->m_rs_lock){....}-{2:2}, at: rds_send_remove_from_sock+0x340/0x9e0 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+0x39/0x50 kernel/locking/spinlock.c:162 rds_message_purge net/rds/message.c:138 [inline] rds_message_put+0x1d9/0xc20 net/rds/message.c:180 rds_inc_put net/rds/recv.c:82 [inline] rds_inc_put+0x13a/0x1a0 net/rds/recv.c:76 rds_clear_recv_queue+0x147/0x350 net/rds/recv.c:767 rds_release+0xd4/0x3b0 net/rds/af_rds.c:73 __sock_release+0xcd/0x280 net/socket.c:650 sock_close+0x18/0x20 net/socket.c:1365 __fput+0x277/0x9d0 fs/file_table.c:317 task_work_run+0xdd/0x1a0 kernel/task_work.c:177 ptrace_notify+0x114/0x140 kernel/signal.c:2353 ptrace_report_syscall include/linux/ptrace.h:420 [inline] ptrace_report_syscall_exit include/linux/ptrace.h:482 [inline] syscall_exit_work kernel/entry/common.c:249 [inline] syscall_exit_to_user_mode_prepare+0xdb/0x230 kernel/entry/common.c:276 __syscall_exit_to_user_mode_work kernel/entry/common.c:281 [inline] syscall_exit_to_user_mode+0x9/0x50 kernel/entry/common.c:294 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x46/0xb0 -> #0 (&rs->rs_recv_lock){....}-{2:2}: check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3829 [inline] __lock_acquire+0x2abe/0x5660 kernel/locking/lockdep.c:5053 lock_acquire kernel/locking/lockdep.c:5665 [inline] lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5630 __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline] _raw_read_lock_irqsave+0x45/0x90 kernel/locking/spinlock.c:236 rds_wake_sk_sleep+0x1f/0xe0 net/rds/af_rds.c:109 rds_send_remove_from_sock+0xb9/0x9e0 net/rds/send.c:634 rds_send_path_drop_acked+0x2ef/0x3d0 net/rds/send.c:710 rds_tcp_write_space+0x1b1/0x690 net/rds/tcp_send.c:198 tcp_new_space net/ipv4/tcp_input.c:5454 [inline] tcp_check_space net/ipv4/tcp_input.c:5473 [inline] tcp_check_space+0x3d0/0x800 net/ipv4/tcp_input.c:5467 tcp_data_snd_check net/ipv4/tcp_input.c:5482 [inline] tcp_rcv_established+0x8c4/0x20e0 net/ipv4/tcp_input.c:5989 tcp_v4_do_rcv+0x66c/0x9b0 net/ipv4/tcp_ipv4.c:1659 sk_backlog_rcv include/net/sock.h:1047 [inline] __release_sock+0x134/0x3b0 net/core/sock.c:2849 release_sock+0x54/0x1b0 net/core/sock.c:3404 rds_send_xmit+0x143f/0x2540 net/rds/send.c:422 rds_sendmsg+0x2782/0x3040 net/rds/send.c:1382 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 __sys_sendto+0x21a/0x320 net/socket.c:2119 __do_sys_sendto net/socket.c:2131 [inline] __se_sys_sendto net/socket.c:2127 [inline] __x64_sys_sendto+0xdd/0x1b0 net/socket.c:2127 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 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-executor266/4295: #0: ffff88807561ceb0 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1677 [inline] #0: ffff88807561ceb0 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: tcp_sock_set_cork+0x16/0x90 net/ipv4/tcp.c:3215 #1: ffff88807561d138 (k-clock-AF_INET){++.-}-{2:2}, at: rds_tcp_write_space+0x25/0x690 net/rds/tcp_send.c:184 #2: ffff88801ff73900 (&rm->m_rs_lock){....}-{2:2}, at: rds_send_remove_from_sock+0x340/0x9e0 net/rds/send.c:628 stack backtrace: CPU: 0 PID: 4295 Comm: syz-executor266 Not tainted 5.19.0-rc3-syzkaller-00336-g0840a7914caa #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2175 check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3829 [inline] __lock_acquire+0x2abe/0x5660 kernel/locking/lockdep.c:5053 lock_acquire kernel/locking/lockdep.c:5665 [inline] lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5630 __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline] _raw_read_lock_irqsave+0x45/0x90 kernel/locking/spinlock.c:236 rds_wake_sk_sleep+0x1f/0xe0 net/rds/af_rds.c:109 rds_send_remove_from_sock+0xb9/0x9e0 net/rds/send.c:634 rds_send_path_drop_acked+0x2ef/0x3d0 net/rds/send.c:710 rds_tcp_write_space+0x1b1/0x690 net/rds/tcp_send.c:198 tcp_new_space net/ipv4/tcp_input.c:5454 [inline] tcp_check_space net/ipv4/tcp_input.c:5473 [inline] tcp_check_space+0x3d0/0x800 net/ipv4/tcp_input.c:5467 tcp_data_snd_check net/ipv4/tcp_input.c:5482 [inline] tcp_rcv_established+0x8c4/0x20e0 net/ipv4/tcp_input.c:5989 tcp_v4_do_rcv+0x66c/0x9b0 net/ipv4/tcp_ipv4.c:1659 sk_backlog_rcv include/net/sock.h:1047 [inline] __release_sock+0x134/0x3b0 net/core/sock.c:2849 release_sock+0x54/0x1b0 net/core/sock.c:3404 rds_send_xmit+0x143f/0x2540 net/rds/send.c:422 rds_sendmsg+0x2782/0x3040 net/rds/send.c:1382 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 __sys_sendto+0x21a/0x320 net/socket.c:2119 __do_sys_sendto net/socket.c:2131 [inline] __se_sys_sendto net/socket.c:2127 [inline] __x64_sys_sendto+0xdd/0x1b0 net/socket.c:2127 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7f3fa3b51139 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:00007f3fa3afe308 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 00007f3fa3bda4c8 RCX: 00007f3fa3b51139 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000005 RBP: 00007f3fa3bda4c0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f3fa3ba75d0 R13: 00007ffc869b8eff R14: 00007f3fa3afe400 R15: 0000000000022000