====================================================== WARNING: possible circular locking dependency detected 6.3.0-syzkaller-13425-g8a690c151134 #0 Not tainted ------------------------------------------------------ syz-executor248/5332 is trying to acquire lock: ffff88802b32bc70 (&rs->rs_recv_lock){...-}-{2:2}, at: rds_wake_sk_sleep+0x23/0xe0 net/rds/af_rds.c:109 but task is already holding lock: ffff888072dea900 (&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+0x3d/0x60 kernel/locking/spinlock.c:162 rds_message_purge net/rds/message.c:138 [inline] rds_message_put+0x1dd/0xc30 net/rds/message.c:180 rds_inc_put net/rds/recv.c:83 [inline] rds_inc_put+0x13e/0x1a0 net/rds/recv.c:77 rds_clear_recv_queue+0x14b/0x350 net/rds/recv.c:768 rds_release+0xd8/0x3c0 net/rds/af_rds.c:73 __sock_release+0xcd/0x290 net/socket.c:653 sock_close+0x1c/0x20 net/socket.c:1397 __fput+0x27c/0xa90 fs/file_table.c:321 task_work_run+0x16f/0x270 kernel/task_work.c:179 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xad3/0x2960 kernel/exit.c:871 do_group_exit+0xd4/0x2a0 kernel/exit.c:1021 __do_sys_exit_group kernel/exit.c:1032 [inline] __se_sys_exit_group kernel/exit.c:1030 [inline] __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1030 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 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:3108 [inline] check_prevs_add kernel/locking/lockdep.c:3227 [inline] validate_chain kernel/locking/lockdep.c:3842 [inline] __lock_acquire+0x2f21/0x5df0 kernel/locking/lockdep.c:5074 lock_acquire kernel/locking/lockdep.c:5691 [inline] lock_acquire+0x1b1/0x520 kernel/locking/lockdep.c:5656 __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline] _raw_read_lock_irqsave+0x49/0x90 kernel/locking/spinlock.c:236 rds_wake_sk_sleep+0x23/0xe0 net/rds/af_rds.c:109 rds_send_remove_from_sock+0xb9/0x9e0 net/rds/send.c:634 rds_send_path_drop_acked+0x2f3/0x3d0 net/rds/send.c:710 rds_tcp_write_space+0x1b5/0x6d0 net/rds/tcp_send.c:198 tcp_new_space net/ipv4/tcp_input.c:5483 [inline] tcp_check_space+0x11b/0x810 net/ipv4/tcp_input.c:5502 tcp_data_snd_check net/ipv4/tcp_input.c:5511 [inline] tcp_rcv_established+0x13bc/0x1f90 net/ipv4/tcp_input.c:5930 tcp_v4_do_rcv+0x65a/0x9c0 net/ipv4/tcp_ipv4.c:1721 sk_backlog_rcv include/net/sock.h:1113 [inline] __release_sock+0x133/0x3b0 net/core/sock.c:2917 release_sock+0x58/0x1b0 net/core/sock.c:3484 rds_send_xmit+0xafc/0x2580 net/rds/send.c:422 rds_sendmsg+0x27d3/0x31a0 net/rds/send.c:1381 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg+0xde/0x190 net/socket.c:747 ____sys_sendmsg+0x71c/0x900 net/socket.c:2503 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2557 __sys_sendmsg+0xf7/0x1c0 net/socket.c:2586 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 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-executor248/5332: #0: ffff8880218256f0 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1697 [inline] #0: ffff8880218256f0 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: tcp_sock_set_cork+0x1a/0xa0 net/ipv4/tcp.c:3343 #1: ffff888021825978 (k-clock-AF_INET){++.-}-{2:2}, at: rds_tcp_write_space+0x29/0x6d0 net/rds/tcp_send.c:184 #2: ffff888072dea900 (&rm->m_rs_lock){..-.}-{2:2}, at: rds_send_remove_from_sock+0x340/0x9e0 net/rds/send.c:628 stack backtrace: CPU: 0 PID: 5332 Comm: syz-executor248 Not tainted 6.3.0-syzkaller-13425-g8a690c151134 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2188 check_prev_add kernel/locking/lockdep.c:3108 [inline] check_prevs_add kernel/locking/lockdep.c:3227 [inline] validate_chain kernel/locking/lockdep.c:3842 [inline] __lock_acquire+0x2f21/0x5df0 kernel/locking/lockdep.c:5074 lock_acquire kernel/locking/lockdep.c:5691 [inline] lock_acquire+0x1b1/0x520 kernel/locking/lockdep.c:5656 __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline] _raw_read_lock_irqsave+0x49/0x90 kernel/locking/spinlock.c:236 rds_wake_sk_sleep+0x23/0xe0 net/rds/af_rds.c:109 rds_send_remove_from_sock+0xb9/0x9e0 net/rds/send.c:634 rds_send_path_drop_acked+0x2f3/0x3d0 net/rds/send.c:710 rds_tcp_write_space+0x1b5/0x6d0 net/rds/tcp_send.c:198 tcp_new_space net/ipv4/tcp_input.c:5483 [inline] tcp_check_space+0x11b/0x810 net/ipv4/tcp_input.c:5502 tcp_data_snd_check net/ipv4/tcp_input.c:5511 [inline] tcp_rcv_established+0x13bc/0x1f90 net/ipv4/tcp_input.c:5930 tcp_v4_do_rcv+0x65a/0x9c0 net/ipv4/tcp_ipv4.c:1721 sk_backlog_rcv include/net/sock.h:1113 [inline] __release_sock+0x133/0x3b0 net/core/sock.c:2917 release_sock+0x58/0x1b0 net/core/sock.c:3484 rds_send_xmit+0xafc/0x2580 net/rds/send.c:422 rds_sendmsg+0x27d3/0x31a0 net/rds/send.c:1381 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg+0xde/0x190 net/socket.c:747 ____sys_sendmsg+0x71c/0x900 net/socket.c:2503 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2557 __sys_sendmsg+0xf7/0x1c0 net/socket.c:2586 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f4b81c63c59 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 11 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:00007f4b81bb2318 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f4b81ceb458 RCX: 00007f4b81c63c59 RDX: 0000000000000000 RSI: 00000000200000c0 RDI: 0000000000000004 RBP: 00007f4b81ceb450 R08: 00007f4b81bb2700 R09: 0000000000000000 R10: 00007f4b81bb2700 R11: 0000000000000246 R12: 00007f4b81cb9064 R13: 00007fffc1d60def R14: 00007f4b81bb2400 R15: 0000000000022000