====================================================== WARNING: possible circular locking dependency detected 6.6.0-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.3/12144 is trying to acquire lock: ffff8880217af2b0 (&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: ffff88807c53c900 (&rm->m_rs_lock){..-.}-{2:2}, at: rds_send_remove_from_sock+0x155/0xa50 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+0x3a/0x50 kernel/locking/spinlock.c:162 rds_message_purge net/rds/message.c:138 [inline] rds_message_put+0x1dd/0xc40 net/rds/message.c:180 rds_inc_put net/rds/recv.c:83 [inline] rds_inc_put+0x13c/0x1a0 net/rds/recv.c:77 rds_clear_recv_queue+0x14c/0x350 net/rds/recv.c:768 rds_release+0xdb/0x3c0 net/rds/af_rds.c:73 __sock_release+0xae/0x260 net/socket.c:659 sock_close+0x1c/0x20 net/socket.c:1419 __fput+0x3f7/0xa70 fs/file_table.c:384 __fput_sync+0x47/0x50 fs/file_table.c:465 __do_sys_close fs/open.c:1572 [inline] __se_sys_close fs/open.c:1557 [inline] __x64_sys_close+0x87/0xf0 fs/open.c:1557 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/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:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3868 [inline] __lock_acquire+0x2e3d/0x5de0 kernel/locking/lockdep.c:5136 lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5718 __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline] _raw_read_lock_irqsave+0x46/0x90 kernel/locking/spinlock.c:236 rds_wake_sk_sleep+0x23/0xe0 net/rds/af_rds.c:109 rds_send_remove_from_sock+0x1e9/0xa50 net/rds/send.c:634 rds_send_path_drop_acked+0x2f4/0x3c0 net/rds/send.c:710 rds_tcp_write_space+0x1b5/0x6c0 net/rds/tcp_send.c:199 tcp_new_space net/ipv4/tcp_input.c:5518 [inline] tcp_check_space+0x178/0x8c0 net/ipv4/tcp_input.c:5537 tcp_data_snd_check net/ipv4/tcp_input.c:5546 [inline] tcp_rcv_established+0x11c9/0x1fa0 net/ipv4/tcp_input.c:5965 tcp_v4_do_rcv+0x669/0x9e0 net/ipv4/tcp_ipv4.c:1728 sk_backlog_rcv include/net/sock.h:1121 [inline] __release_sock+0x132/0x3a0 net/core/sock.c:2983 release_sock+0x58/0x1b0 net/core/sock.c:3520 rds_send_xmit+0x164a/0x2490 net/rds/send.c:422 rds_sendmsg+0x2ae6/0x31d0 net/rds/send.c:1381 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0xd5/0x180 net/socket.c:745 __sys_sendto+0x255/0x340 net/socket.c:2194 __do_sys_sendto net/socket.c:2206 [inline] __se_sys_sendto net/socket.c:2202 [inline] __x64_sys_sendto+0xe0/0x1b0 net/socket.c:2202 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/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-executor.3/12144: #0: ffff88802045be70 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1720 [inline] #0: ffff88802045be70 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: tcp_sock_set_cork+0x1c/0x90 net/ipv4/tcp.c:3229 #1: ffff88802045c0f8 (k-clock-AF_INET){++.-}-{2:2}, at: rds_tcp_write_space+0x29/0x6c0 net/rds/tcp_send.c:185 #2: ffff88807c53c900 (&rm->m_rs_lock){..-.}-{2:2}, at: rds_send_remove_from_sock+0x155/0xa50 net/rds/send.c:628 stack backtrace: CPU: 1 PID: 12144 Comm: syz-executor.3 Not tainted 6.6.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 check_noncircular+0x311/0x3f0 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+0x2e3d/0x5de0 kernel/locking/lockdep.c:5136 lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5718 __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline] _raw_read_lock_irqsave+0x46/0x90 kernel/locking/spinlock.c:236 rds_wake_sk_sleep+0x23/0xe0 net/rds/af_rds.c:109 rds_send_remove_from_sock+0x1e9/0xa50 net/rds/send.c:634 rds_send_path_drop_acked+0x2f4/0x3c0 net/rds/send.c:710 rds_tcp_write_space+0x1b5/0x6c0 net/rds/tcp_send.c:199 tcp_new_space net/ipv4/tcp_input.c:5518 [inline] tcp_check_space+0x178/0x8c0 net/ipv4/tcp_input.c:5537 tcp_data_snd_check net/ipv4/tcp_input.c:5546 [inline] tcp_rcv_established+0x11c9/0x1fa0 net/ipv4/tcp_input.c:5965 tcp_v4_do_rcv+0x669/0x9e0 net/ipv4/tcp_ipv4.c:1728 sk_backlog_rcv include/net/sock.h:1121 [inline] __release_sock+0x132/0x3a0 net/core/sock.c:2983 release_sock+0x58/0x1b0 net/core/sock.c:3520 rds_send_xmit+0x164a/0x2490 net/rds/send.c:422 rds_sendmsg+0x2ae6/0x31d0 net/rds/send.c:1381 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0xd5/0x180 net/socket.c:745 __sys_sendto+0x255/0x340 net/socket.c:2194 __do_sys_sendto net/socket.c:2206 [inline] __se_sys_sendto net/socket.c:2202 [inline] __x64_sys_sendto+0xe0/0x1b0 net/socket.c:2202 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f7056c7cae9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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:00007f7057a0c0c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 00007f7056d9bf80 RCX: 00007f7056c7cae9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000006 RBP: 00007f7056cc847a R08: 0000000020000040 R09: 0000000000000010 R10: 0000000000000040 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f7056d9bf80 R15: 00007f7056ebfa48 netlink: 4 bytes leftover after parsing attributes in process `syz-executor.3'. IPv6: RTM_NEWROUTE with no NLM_F_CREATE or NLM_F_REPLACE IPv6: NLM_F_CREATE should be set when creating new route