============================================ WARNING: possible recursive locking detected 5.15.158-syzkaller #0 Not tainted -------------------------------------------- syz-executor.4/5653 is trying to acquire lock: ffff8880720e6468 (&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: ffff8880720e6468 (&htab->buckets[i].lock){+...}-{2:2}, at: sock_hash_delete_from_link net/core/sock_map.c:918 [inline] ffff8880720e6468 (&htab->buckets[i].lock){+...}-{2:2}, at: sock_map_unlink net/core/sock_map.c:1499 [inline] ffff8880720e6468 (&htab->buckets[i].lock){+...}-{2:2}, at: sock_map_remove_links+0x1c1/0x6b0 net/core/sock_map.c:1511 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&htab->buckets[i].lock); lock(&htab->buckets[i].lock); *** DEADLOCK *** May be due to missing lock nesting notation 5 locks held by syz-executor.4/5653: #0: ffff88804658dc10 (&sb->s_type->i_mutex_key#11){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:789 [inline] #0: ffff88804658dc10 (&sb->s_type->i_mutex_key#11){+.+.}-{3:3}, at: __sock_release net/socket.c:648 [inline] #0: ffff88804658dc10 (&sb->s_type->i_mutex_key#11){+.+.}-{3:3}, at: sock_close+0x98/0x230 net/socket.c:1336 #1: ffff8880785ff120 (sk_lock-AF_UNIX){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1668 [inline] #1: ffff8880785ff120 (sk_lock-AF_UNIX){+.+.}-{0:0}, at: sock_map_close+0x1f/0x290 net/core/sock_map.c:1567 #2: ffffffff8c91fae0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311 #3: ffff8880720e6468 (&htab->buckets[i].lock){+...}-{2:2}, at: sock_hash_delete_from_link net/core/sock_map.c:918 [inline] #3: ffff8880720e6468 (&htab->buckets[i].lock){+...}-{2:2}, at: sock_map_unlink net/core/sock_map.c:1499 [inline] #3: ffff8880720e6468 (&htab->buckets[i].lock){+...}-{2:2}, at: sock_map_remove_links+0x1c1/0x6b0 net/core/sock_map.c:1511 #4: ffffffff8c91fae0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311 stack backtrace: CPU: 1 PID: 5653 Comm: syz-executor.4 Not tainted 5.15.158-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 print_deadlock_bug kernel/locking/lockdep.c:2946 [inline] check_deadlock kernel/locking/lockdep.c:2989 [inline] validate_chain+0x46d2/0x5930 kernel/locking/lockdep.c:3775 __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_bc4ba9860fbb0da4+0x3e/0x2b0 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_run4+0x1ea/0x390 kernel/trace/bpf_trace.c:1919 __bpf_trace_mm_page_alloc+0xba/0xe0 include/trace/events/kmem.h:201 trace_mm_page_alloc include/trace/events/kmem.h:201 [inline] __alloc_pages+0x6e0/0x700 mm/page_alloc.c:5445 stack_depot_save+0x319/0x440 lib/stackdepot.c:302 save_stack+0x104/0x1e0 mm/page_owner.c:120 __set_page_owner+0x37/0x300 mm/page_owner.c:181 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159 __alloc_pages+0x272/0x700 mm/page_alloc.c:5423 stack_depot_save+0x319/0x440 lib/stackdepot.c:302 kasan_save_stack+0x4d/0x60 mm/kasan/common.c:40 kasan_record_aux_stack+0xba/0x100 mm/kasan/generic.c:348 kvfree_call_rcu+0x118/0x8a0 kernel/rcu/tree.c:3596 sock_hash_free_elem net/core/sock_map.c:901 [inline] sock_hash_delete_from_link net/core/sock_map.c:924 [inline] sock_map_unlink net/core/sock_map.c:1499 [inline] sock_map_remove_links+0x5a3/0x6b0 net/core/sock_map.c:1511 sock_map_close+0xf0/0x290 net/core/sock_map.c:1576 unix_release+0x7e/0xc0 net/unix/af_unix.c:949 __sock_release net/socket.c:649 [inline] sock_close+0xcd/0x230 net/socket.c:1336 __fput+0x3bf/0x890 fs/file_table.c:280 task_work_run+0x129/0x1a0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0x106/0x130 kernel/entry/common.c:181 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x5d/0x240 kernel/entry/common.c:307 do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7fd0eca82c5a Code: 48 3d 00 f0 ff ff 77 48 c3 0f 1f 80 00 00 00 00 48 83 ec 18 89 7c 24 0c e8 03 7f 02 00 8b 7c 24 0c 89 c2 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 36 89 d7 89 44 24 0c e8 63 7f 02 00 8b 44 24 RSP: 002b:00007ffd1d8bef60 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000005 RCX: 00007fd0eca82c5a RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000004 RBP: 00007ffd1d8bf038 R08: 00007fd0eca06000 R09: 0000000000000001 R10: 0000000000000001 R11: 0000000000000293 R12: 000000000002f013 R13: 00007fd0ecbb1f8c R14: 00007fd0ecbb1f80 R15: 0000000000000032