====================================================== WARNING: possible circular locking dependency detected 6.1.85-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.4/10620 is trying to acquire lock: ffff888079607338 (&htab->buckets[i].lock){+.-.}-{2:2}, at: sock_hash_delete_elem+0x177/0x400 net/core/sock_map.c:938 but task is already holding lock: ffff88802197fbb8 (clock-AF_UNIX){++..}-{2:2}, at: sk_psock_drop+0x30/0x500 net/core/skmsg.c:836 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (clock-AF_UNIX){++..}-{2:2}: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __raw_write_lock_bh include/linux/rwlock_api_smp.h:202 [inline] _raw_write_lock_bh+0x31/0x40 kernel/locking/spinlock.c:334 sk_psock_drop+0x30/0x500 net/core/skmsg.c:836 sock_hash_delete_elem+0x388/0x400 net/core/sock_map.c:942 map_delete_elem+0x3ff/0x550 kernel/bpf/syscall.c:1501 __sys_bpf+0x350/0x6c0 kernel/bpf/syscall.c:4996 __do_sys_bpf kernel/bpf/syscall.c:5109 [inline] __se_sys_bpf kernel/bpf/syscall.c:5107 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:5107 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #0 (&htab->buckets[i].lock){+.-.}-{2:2}: check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain+0x1661/0x5950 kernel/locking/lockdep.c:3825 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline] _raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178 sock_hash_delete_elem+0x177/0x400 net/core/sock_map.c:938 bpf_prog_967a36a528e40c40+0x3f/0x43 bpf_dispatcher_nop_func include/linux/bpf.h:989 [inline] __bpf_prog_run include/linux/filter.h:603 [inline] bpf_prog_run include/linux/filter.h:610 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2273 [inline] bpf_trace_run2+0x1fd/0x410 kernel/trace/bpf_trace.c:2312 __bpf_trace_kfree+0x6e/0x90 include/trace/events/kmem.h:94 trace_kfree include/trace/events/kmem.h:94 [inline] kfree+0xf6/0x190 mm/slab_common.c:994 __bpf_prog_put_noref+0x9c/0x2b0 kernel/bpf/syscall.c:2059 bpf_prog_put_deferred+0x2ee/0x3e0 kernel/bpf/syscall.c:2085 __bpf_prog_put kernel/bpf/syscall.c:2097 [inline] bpf_prog_put+0x260/0x2a0 kernel/bpf/syscall.c:2104 psock_set_prog include/linux/skmsg.h:470 [inline] sk_psock_stop_verdict net/core/skmsg.c:1242 [inline] sk_psock_drop+0x243/0x500 net/core/skmsg.c:842 sk_psock_put include/linux/skmsg.h:454 [inline] sock_map_close+0x205/0x2d0 net/core/sock_map.c:1638 unix_release+0x7e/0xc0 net/unix/af_unix.c:1038 __sock_release net/socket.c:654 [inline] sock_close+0xcd/0x230 net/socket.c:1400 __fput+0x3b7/0x890 fs/file_table.c:320 task_work_run+0x246/0x300 kernel/task_work.c:179 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xa73/0x26a0 kernel/exit.c:869 do_group_exit+0x202/0x2b0 kernel/exit.c:1019 __do_sys_exit_group kernel/exit.c:1030 [inline] __se_sys_exit_group kernel/exit.c:1028 [inline] __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1028 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(clock-AF_UNIX); lock(&htab->buckets[i].lock); lock(clock-AF_UNIX); lock(&htab->buckets[i].lock); *** DEADLOCK *** 3 locks held by syz-executor.4/10620: #0: ffff888057e19a10 (&sb->s_type->i_mutex_key#10){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #0: ffff888057e19a10 (&sb->s_type->i_mutex_key#10){+.+.}-{3:3}, at: __sock_release net/socket.c:653 [inline] #0: ffff888057e19a10 (&sb->s_type->i_mutex_key#10){+.+.}-{3:3}, at: sock_close+0x98/0x230 net/socket.c:1400 #1: ffff88802197fbb8 (clock-AF_UNIX){++..}-{2:2}, at: sk_psock_drop+0x30/0x500 net/core/skmsg.c:836 #2: ffffffff8d12ac40 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #2: ffffffff8d12ac40 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #2: ffffffff8d12ac40 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2272 [inline] #2: ffffffff8d12ac40 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x110/0x410 kernel/trace/bpf_trace.c:2312 stack backtrace: CPU: 0 PID: 10620 Comm: syz-executor.4 Not tainted 6.1.85-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 check_noncircular+0x2fa/0x3b0 kernel/locking/lockdep.c:2170 check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain+0x1661/0x5950 kernel/locking/lockdep.c:3825 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline] _raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178 sock_hash_delete_elem+0x177/0x400 net/core/sock_map.c:938 bpf_prog_967a36a528e40c40+0x3f/0x43 bpf_dispatcher_nop_func include/linux/bpf.h:989 [inline] __bpf_prog_run include/linux/filter.h:603 [inline] bpf_prog_run include/linux/filter.h:610 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2273 [inline] bpf_trace_run2+0x1fd/0x410 kernel/trace/bpf_trace.c:2312 __bpf_trace_kfree+0x6e/0x90 include/trace/events/kmem.h:94 trace_kfree include/trace/events/kmem.h:94 [inline] kfree+0xf6/0x190 mm/slab_common.c:994 __bpf_prog_put_noref+0x9c/0x2b0 kernel/bpf/syscall.c:2059 bpf_prog_put_deferred+0x2ee/0x3e0 kernel/bpf/syscall.c:2085 __bpf_prog_put kernel/bpf/syscall.c:2097 [inline] bpf_prog_put+0x260/0x2a0 kernel/bpf/syscall.c:2104 psock_set_prog include/linux/skmsg.h:470 [inline] sk_psock_stop_verdict net/core/skmsg.c:1242 [inline] sk_psock_drop+0x243/0x500 net/core/skmsg.c:842 sk_psock_put include/linux/skmsg.h:454 [inline] sock_map_close+0x205/0x2d0 net/core/sock_map.c:1638 unix_release+0x7e/0xc0 net/unix/af_unix.c:1038 __sock_release net/socket.c:654 [inline] sock_close+0xcd/0x230 net/socket.c:1400 __fput+0x3b7/0x890 fs/file_table.c:320 task_work_run+0x246/0x300 kernel/task_work.c:179 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xa73/0x26a0 kernel/exit.c:869 do_group_exit+0x202/0x2b0 kernel/exit.c:1019 __do_sys_exit_group kernel/exit.c:1030 [inline] __se_sys_exit_group kernel/exit.c:1028 [inline] __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1028 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f719147de69 Code: Unable to access opcode bytes at 0x7f719147de3f. RSP: 002b:00007f71921c5af8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 000000000000000b RCX: 00007f719147de69 RDX: 00007f71914d78ca RSI: 0000000000000000 RDI: 000000000000000b RBP: 00007f71914ca47a R08: 0000000000000010 R09: 000000000000000b R10: 00007ffd913a00b0 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f71915ac1f0 R15: 00007ffd9139ae88