====================================================== WARNING: possible circular locking dependency detected 5.15.158-syzkaller #0 Not tainted ------------------------------------------------------ kworker/u4:1/144 is trying to acquire lock: ffff88801d97f260 (&htab->buckets[i].lock){+.-.}-{2:2}, at: sock_hash_delete_elem+0x177/0x400 net/core/sock_map.c:943 but task is already holding lock: ffff888057c869d8 (clock-AF_INET6){++--}-{2:2}, at: rds_tcp_write_space+0x30/0x560 net/rds/tcp_send.c:184 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (clock-AF_INET6){++--}-{2:2}: lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __raw_write_lock_bh include/linux/rwlock_api_smp.h:203 [inline] _raw_write_lock_bh+0x31/0x40 kernel/locking/spinlock.c:324 sk_psock_drop+0x2f/0x3b0 net/core/skmsg.c:835 sock_hash_update_common+0x911/0xa30 net/core/sock_map.c:1034 sock_map_update_elem_sys+0x485/0x770 net/core/sock_map.c:590 map_update_elem+0x6a0/0x7c0 kernel/bpf/syscall.c:1185 __sys_bpf+0x2fd/0x670 kernel/bpf/syscall.c:4639 __do_sys_bpf kernel/bpf/syscall.c:4755 [inline] __se_sys_bpf kernel/bpf/syscall.c:4753 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4753 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #0 (&htab->buckets[i].lock){+.-.}-{2:2}: check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain+0x1649/0x5930 kernel/locking/lockdep.c:3788 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline] _raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178 sock_hash_delete_elem+0x177/0x400 net/core/sock_map.c:943 bpf_prog_e0ea4f330b3ad171+0x5b/0x94 bpf_dispatcher_nop_func include/linux/bpf.h:790 [inline] __bpf_prog_run include/linux/filter.h:628 [inline] bpf_prog_run include/linux/filter.h:635 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline] bpf_trace_run2+0x19e/0x340 kernel/trace/bpf_trace.c:1917 __bpf_trace_kfree+0x6e/0x90 include/trace/events/kmem.h:118 trace_kfree include/trace/events/kmem.h:118 [inline] kfree+0x22f/0x270 mm/slub.c:4549 rds_send_remove_from_sock+0x66e/0x800 net/rds/send.c:666 rds_send_path_drop_acked+0x362/0x3a0 net/rds/send.c:709 rds_tcp_write_space+0x193/0x560 net/rds/tcp_send.c:198 tcp_new_space net/ipv4/tcp_input.c:5466 [inline] tcp_check_space+0x141/0x930 net/ipv4/tcp_input.c:5485 tcp_data_snd_check net/ipv4/tcp_input.c:5494 [inline] tcp_rcv_established+0xeb6/0x1e20 net/ipv4/tcp_input.c:5989 tcp_v6_do_rcv+0x4f2/0x10f0 net/ipv6/tcp_ipv6.c:1526 sk_backlog_rcv include/net/sock.h:1059 [inline] __release_sock+0x198/0x4b0 net/core/sock.c:2724 release_sock+0x5d/0x1c0 net/core/sock.c:3265 rds_send_xmit+0x1d16/0x2530 net/rds/send.c:421 rds_send_worker+0x79/0x2b0 net/rds/threads.c:200 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457 kthread+0x3f6/0x4f0 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:300 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(clock-AF_INET6); lock(&htab->buckets[i].lock); lock(clock-AF_INET6); lock(&htab->buckets[i].lock); *** DEADLOCK *** 5 locks held by kworker/u4:1/144: #0: ffff8880241b4938 ((wq_completion)krdsd){+.+.}-{0:0}, at: process_one_work+0x78a/0x10c0 kernel/workqueue.c:2283 #1: ffffc9000160fd20 ((work_completion)(&(&cp->cp_send_w)->work)){+.+.}-{0:0}, at: process_one_work+0x7d0/0x10c0 kernel/workqueue.c:2285 #2: ffff888057c86720 (k-sk_lock-AF_INET6){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1668 [inline] #2: ffff888057c86720 (k-sk_lock-AF_INET6){+.+.}-{0:0}, at: tcp_sock_set_cork+0x29/0x1b0 net/ipv4/tcp.c:3244 #3: ffff888057c869d8 (clock-AF_INET6){++--}-{2:2}, at: rds_tcp_write_space+0x30/0x560 net/rds/tcp_send.c:184 #4: ffffffff8c91fae0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311 stack backtrace: CPU: 1 PID: 144 Comm: kworker/u4:1 Not tainted 5.15.158-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Workqueue: krdsd rds_send_worker Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 check_noncircular+0x2f8/0x3b0 kernel/locking/lockdep.c:2133 check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain+0x1649/0x5930 kernel/locking/lockdep.c:3788 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline] _raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178 sock_hash_delete_elem+0x177/0x400 net/core/sock_map.c:943 bpf_prog_e0ea4f330b3ad171+0x5b/0x94 bpf_dispatcher_nop_func include/linux/bpf.h:790 [inline] __bpf_prog_run include/linux/filter.h:628 [inline] bpf_prog_run include/linux/filter.h:635 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline] bpf_trace_run2+0x19e/0x340 kernel/trace/bpf_trace.c:1917 __bpf_trace_kfree+0x6e/0x90 include/trace/events/kmem.h:118 trace_kfree include/trace/events/kmem.h:118 [inline] kfree+0x22f/0x270 mm/slub.c:4549 rds_send_remove_from_sock+0x66e/0x800 net/rds/send.c:666 rds_send_path_drop_acked+0x362/0x3a0 net/rds/send.c:709 rds_tcp_write_space+0x193/0x560 net/rds/tcp_send.c:198 tcp_new_space net/ipv4/tcp_input.c:5466 [inline] tcp_check_space+0x141/0x930 net/ipv4/tcp_input.c:5485 tcp_data_snd_check net/ipv4/tcp_input.c:5494 [inline] tcp_rcv_established+0xeb6/0x1e20 net/ipv4/tcp_input.c:5989 tcp_v6_do_rcv+0x4f2/0x10f0 net/ipv6/tcp_ipv6.c:1526 sk_backlog_rcv include/net/sock.h:1059 [inline] __release_sock+0x198/0x4b0 net/core/sock.c:2724 release_sock+0x5d/0x1c0 net/core/sock.c:3265 rds_send_xmit+0x1d16/0x2530 net/rds/send.c:421 rds_send_worker+0x79/0x2b0 net/rds/threads.c:200 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457 kthread+0x3f6/0x4f0 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:300 tipc: Subscription rejected, illegal request