====================================================== WARNING: possible circular locking dependency detected 5.15.157-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.1/3528 is trying to acquire lock: ffff888019864238 (&psock->ingress_lock){+...}-{2:2}, at: spin_lock_bh include/linux/spinlock.h:368 [inline] ffff888019864238 (&psock->ingress_lock){+...}-{2:2}, at: sk_psock_stop+0x31/0x4c0 net/core/skmsg.c:802 but task is already holding lock: ffff888061998068 (&htab->buckets[i].lock){+.-.}-{2:2}, at: sock_hash_delete_elem+0x177/0x400 net/core/sock_map.c:943 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&htab->buckets[i].lock){+.-.}-{2:2}: 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 0xffffffffa002c76d bpf_dispatcher_nop_func include/linux/bpf.h:790 [inline] __bpf_prog_run include/linux/filter.h:621 [inline] bpf_prog_run include/linux/filter.h:635 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline] bpf_trace_run2+0x29e/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 skb_free_head net/core/skbuff.c:655 [inline] skb_release_data+0x73a/0x8a0 net/core/skbuff.c:677 skb_release_all net/core/skbuff.c:742 [inline] __kfree_skb net/core/skbuff.c:756 [inline] consume_skb+0xa3/0x140 net/core/skbuff.c:914 __sk_msg_free+0x2cd/0x350 net/core/skmsg.c:205 sk_msg_free net/core/skmsg.c:218 [inline] __sk_psock_purge_ingress_msg net/core/skmsg.c:769 [inline] __sk_psock_zap_ingress net/core/skmsg.c:787 [inline] sk_psock_stop+0x44c/0x4c0 net/core/skmsg.c:805 sock_map_close+0x17c/0x290 net/core/sock_map.c:1578 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 -> #0 (&psock->ingress_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 spin_lock_bh include/linux/spinlock.h:368 [inline] sk_psock_stop+0x31/0x4c0 net/core/skmsg.c:802 sk_psock_drop+0x2aa/0x3b0 net/core/skmsg.c:844 sock_hash_delete_elem+0x388/0x400 net/core/sock_map.c:947 bpf_prog_2c29ac5cdc6b1842+0x3a/0xfc0 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 __traceiter_ext4_free_blocks+0x87/0xd0 include/trace/events/ext4.h:901 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_ext_truncate+0x191/0x250 fs/ext4/extents.c:4448 ext4_truncate+0x9fd/0x1130 fs/ext4/inode.c:4238 ext4_evict_inode+0xba1/0x1100 fs/ext4/inode.c:289 evict+0x2a4/0x620 fs/inode.c:587 d_delete_notify include/linux/fsnotify.h:261 [inline] vfs_rmdir+0x33c/0x460 fs/namei.c:4162 do_rmdir+0x368/0x670 fs/namei.c:4210 __do_sys_unlinkat fs/namei.c:4390 [inline] __se_sys_unlinkat fs/namei.c:4384 [inline] __x64_sys_unlinkat+0xdc/0xf0 fs/namei.c:4384 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 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&htab->buckets[i].lock); lock(&psock->ingress_lock); lock(&htab->buckets[i].lock); lock(&psock->ingress_lock); *** DEADLOCK *** 7 locks held by syz-executor.1/3528: #0: ffff8880245e4460 (sb_writers#5){.+.+}-{0:0}, at: mnt_want_write+0x3b/0x80 fs/namespace.c:377 #1: ffff8880704ba1d8 (&type->i_mutex_dir_key#4/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:824 [inline] #1: ffff8880704ba1d8 (&type->i_mutex_dir_key#4/1){+.+.}-{3:3}, at: do_rmdir+0x225/0x670 fs/namei.c:4197 #2: ffff8880245e4650 (sb_internal){.+.+}-{0:0}, at: __sb_start_write include/linux/fs.h:1811 [inline] #2: ffff8880245e4650 (sb_internal){.+.+}-{0:0}, at: sb_start_intwrite include/linux/fs.h:1928 [inline] #2: ffff8880245e4650 (sb_internal){.+.+}-{0:0}, at: ext4_evict_inode+0x375/0x1100 fs/ext4/inode.c:243 #3: ffff88814b708990 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0x12b9/0x1570 fs/jbd2/transaction.c:462 #4: ffff88805d851668 (&ei->i_data_sem){++++}-{3:3}, at: ext4_truncate+0x974/0x1130 fs/ext4/inode.c:4233 #5: ffffffff8c91fb20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311 #6: ffff888061998068 (&htab->buckets[i].lock){+.-.}-{2:2}, at: sock_hash_delete_elem+0x177/0x400 net/core/sock_map.c:943 stack backtrace: CPU: 1 PID: 3528 Comm: syz-executor.1 Not tainted 5.15.157-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/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 spin_lock_bh include/linux/spinlock.h:368 [inline] sk_psock_stop+0x31/0x4c0 net/core/skmsg.c:802 sk_psock_drop+0x2aa/0x3b0 net/core/skmsg.c:844 sock_hash_delete_elem+0x388/0x400 net/core/sock_map.c:947 bpf_prog_2c29ac5cdc6b1842+0x3a/0xfc0 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 __traceiter_ext4_free_blocks+0x87/0xd0 include/trace/events/ext4.h:901 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_ext_truncate+0x191/0x250 fs/ext4/extents.c:4448 ext4_truncate+0x9fd/0x1130 fs/ext4/inode.c:4238 ext4_evict_inode+0xba1/0x1100 fs/ext4/inode.c:289 evict+0x2a4/0x620 fs/inode.c:587 d_delete_notify include/linux/fsnotify.h:261 [inline] vfs_rmdir+0x33c/0x460 fs/namei.c:4162 do_rmdir+0x368/0x670 fs/namei.c:4210 __do_sys_unlinkat fs/namei.c:4390 [inline] __se_sys_unlinkat fs/namei.c:4384 [inline] __x64_sys_unlinkat+0xdc/0xf0 fs/namei.c:4384 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:0x7fd4cb0b9687 Code: 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 07 01 00 00 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:00007ffed17cfa68 EFLAGS: 00000207 ORIG_RAX: 0000000000000107 RAX: ffffffffffffffda RBX: 0000000000000065 RCX: 00007fd4cb0b9687 RDX: 0000000000000200 RSI: 00007ffed17d0be0 RDI: 00000000ffffff9c RBP: 00007fd4cb1053b9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000100 R11: 0000000000000207 R12: 00007ffed17d0be0 R13: 00007fd4cb1053b9 R14: 000000000001936c R15: 0000000000000002