============================================ WARNING: possible recursive locking detected 5.15.158-syzkaller #0 Not tainted -------------------------------------------- syz-executor.4/12783 is trying to acquire lock: ffff88806118d868 (&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: ffff88806118da68 (&htab->buckets[i].lock){+.-.}-{2:2}, at: sock_hash_delete_elem+0x177/0x400 net/core/sock_map.c:943 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 9 locks held by syz-executor.4/12783: #0: ffff88814b750460 (sb_writers#5){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:3037 [inline] #0: ffff88814b750460 (sb_writers#5){.+.+}-{0:0}, at: vfs_fallocate+0x4bd/0x6b0 fs/open.c:307 #1: ffff88806f7797e0 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: inode_lock include/linux/fs.h:789 [inline] #1: ffff88806f7797e0 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: ext4_punch_hole+0x1d4/0xc10 fs/ext4/inode.c:3989 #2: ffff88806f779980 (mapping.invalidate_lock){++++}-{3:3}, at: filemap_invalidate_lock include/linux/fs.h:834 [inline] #2: ffff88806f779980 (mapping.invalidate_lock){++++}-{3:3}, at: ext4_punch_hole+0x3ba/0xc10 fs/ext4/inode.c:4036 #3: ffff88814b754990 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0x12b9/0x1570 fs/jbd2/transaction.c:462 #4: ffff88806f779668 (&ei->i_data_sem){++++}-{3:3}, at: ext4_punch_hole+0x6de/0xc10 fs/ext4/inode.c:4077 #5: ffffffff8c91fae0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311 #6: ffff88806118da68 (&htab->buckets[i].lock){+.-.}-{2:2}, at: sock_hash_delete_elem+0x177/0x400 net/core/sock_map.c:943 #7: ffff88805bf14290 (&psock->link_lock){+...}-{2:2}, at: spin_lock_bh include/linux/spinlock.h:368 [inline] #7: ffff88805bf14290 (&psock->link_lock){+...}-{2:2}, at: sock_map_del_link net/core/sock_map.c:147 [inline] #7: ffff88805bf14290 (&psock->link_lock){+...}-{2:2}, at: sock_map_unref+0xcc/0x5d0 net/core/sock_map.c:182 #8: ffffffff8c91fae0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311 stack backtrace: CPU: 1 PID: 12783 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_586ab708469db861+0x41/0x7c8 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 sk_psock_free_link include/linux/skmsg.h:422 [inline] sock_map_del_link net/core/sock_map.c:160 [inline] sock_map_unref+0x3ac/0x5d0 net/core/sock_map.c:182 sock_hash_delete_elem+0x388/0x400 net/core/sock_map.c:947 bpf_prog_2c29ac5cdc6b1842+0x3a/0x83c 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 trace_ext4_free_blocks include/trace/events/ext4.h:901 [inline] ext4_free_blocks+0x2e0e/0x2ea0 fs/ext4/mballoc.c:6230 ext4_remove_blocks fs/ext4/extents.c:2519 [inline] ext4_ext_rm_leaf fs/ext4/extents.c:2685 [inline] ext4_ext_remove_space+0x24da/0x4db0 fs/ext4/extents.c:2933 ext4_punch_hole+0x7c0/0xc10 fs/ext4/inode.c:4088 ext4_fallocate+0x30a/0x20c0 fs/ext4/extents.c:4740 vfs_fallocate+0x54a/0x6b0 fs/open.c:308 do_vfs_ioctl+0x2317/0x2b70 fs/ioctl.c:853 __do_sys_ioctl fs/ioctl.c:872 [inline] __se_sys_ioctl+0x81/0x160 fs/ioctl.c:860 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 RIP: 0033:0x7f5567f5ad69 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:00007f55664cd0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f5568088f80 RCX: 00007f5567f5ad69 RDX: 0000000020000280 RSI: 000000004030582b RDI: 0000000000000008 RBP: 00007f5567fa749e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f5568088f80 R15: 00007ffcfb8f27b8