================================ WARNING: inconsistent lock state 6.9.0-syzkaller-10323-g8f6a15f095a6 #0 Not tainted -------------------------------- inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage. syz-executor.0/4286 [HC0[0]:SC0[0]:HE0:SE1] takes: ffffffff8ea488b8 (sync_timeline_list_lock){?...}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:376 [inline] ffffffff8ea488b8 (sync_timeline_list_lock){?...}-{2:2}, at: sync_info_debugfs_show+0x36/0x210 drivers/dma-buf/sync_debug.c:147 {IN-HARDIRQ-W} state was registered at: lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162 sync_timeline_debug_remove+0x29/0x1a0 drivers/dma-buf/sync_debug.c:31 sync_timeline_free drivers/dma-buf/sw_sync.c:125 [inline] kref_put include/linux/kref.h:65 [inline] sync_timeline_put drivers/dma-buf/sw_sync.c:137 [inline] timeline_fence_release+0x262/0x340 drivers/dma-buf/sw_sync.c:165 dma_fence_release+0x30b/0x560 drivers/dma-buf/dma-fence.c:560 kref_put include/linux/kref.h:65 [inline] dma_fence_put include/linux/dma-fence.h:297 [inline] dma_fence_put include/linux/dma-fence.h:294 [inline] dma_fence_array_release+0x1fa/0x2e0 drivers/dma-buf/dma-fence-array.c:120 dma_fence_release+0x30b/0x560 drivers/dma-buf/dma-fence.c:560 kref_put include/linux/kref.h:65 [inline] dma_fence_put include/linux/dma-fence.h:297 [inline] dma_fence_put include/linux/dma-fence.h:294 [inline] irq_dma_fence_array_work+0xa9/0xd0 drivers/dma-buf/dma-fence-array.c:52 irq_work_single+0x1bf/0x260 kernel/irq_work.c:221 irq_work_run_list+0x92/0xc0 kernel/irq_work.c:252 irq_work_run+0x58/0xd0 kernel/irq_work.c:261 __sysvec_irq_work+0x8c/0x410 arch/x86/kernel/irq_work.c:22 instr_sysvec_irq_work arch/x86/kernel/irq_work.c:17 [inline] sysvec_irq_work+0x90/0xb0 arch/x86/kernel/irq_work.c:17 asm_sysvec_irq_work+0x1a/0x20 arch/x86/include/asm/idtentry.h:738 __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:160 [inline] _raw_spin_unlock_irq+0x29/0x50 kernel/locking/spinlock.c:202 spin_unlock_irq include/linux/spinlock.h:401 [inline] sw_sync_debugfs_release+0x164/0x240 drivers/dma-buf/sw_sync.c:359 __fput+0x40b/0xbb0 fs/file_table.c:422 task_work_run+0x151/0x250 kernel/task_work.c:180 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop kernel/entry/common.c:114 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x278/0x2a0 kernel/entry/common.c:218 do_syscall_64+0xdc/0x260 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f irq event stamp: 316 hardirqs last enabled at (315): [] mod_objcg_state+0x4c4/0x8d0 mm/memcontrol.c:3536 hardirqs last disabled at (316): [] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:117 [inline] hardirqs last disabled at (316): [] _raw_spin_lock_irq+0x45/0x50 kernel/locking/spinlock.c:170 softirqs last enabled at (232): [] softirq_handle_end kernel/softirq.c:400 [inline] softirqs last enabled at (232): [] handle_softirqs+0x5be/0x8f0 kernel/softirq.c:582 softirqs last disabled at (219): [] __do_softirq kernel/softirq.c:588 [inline] softirqs last disabled at (219): [] invoke_softirq kernel/softirq.c:428 [inline] softirqs last disabled at (219): [] __irq_exit_rcu kernel/softirq.c:637 [inline] softirqs last disabled at (219): [] irq_exit_rcu+0xbb/0x120 kernel/softirq.c:649 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(sync_timeline_list_lock); lock(sync_timeline_list_lock); *** DEADLOCK *** 3 locks held by syz-executor.0/4286: #0: ffff88805e4340c8 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0xeb/0x180 fs/file.c:1191 #1: ffff888068a72790 (&p->lock){+.+.}-{3:3}, at: seq_read_iter+0xde/0x12c0 fs/seq_file.c:182 #2: ffffffff8ea488b8 (sync_timeline_list_lock){?...}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:376 [inline] #2: ffffffff8ea488b8 (sync_timeline_list_lock){?...}-{2:2}, at: sync_info_debugfs_show+0x36/0x210 drivers/dma-buf/sync_debug.c:147 stack backtrace: CPU: 0 PID: 4286 Comm: syz-executor.0 Not tainted 6.9.0-syzkaller-10323-g8f6a15f095a6 #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+0x116/0x1f0 lib/dump_stack.c:114 print_usage_bug kernel/locking/lockdep.c:3971 [inline] valid_state kernel/locking/lockdep.c:4013 [inline] mark_lock_irq kernel/locking/lockdep.c:4216 [inline] mark_lock+0x923/0xc60 kernel/locking/lockdep.c:4678 mark_held_locks+0x9f/0xe0 kernel/locking/lockdep.c:4274 __trace_hardirqs_on_caller kernel/locking/lockdep.c:4292 [inline] lockdep_hardirqs_on_prepare+0x137/0x420 kernel/locking/lockdep.c:4359 trace_hardirqs_on+0x36/0x40 kernel/trace/trace_preemptirq.c:61 __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:159 [inline] _raw_spin_unlock_irq+0x23/0x50 kernel/locking/spinlock.c:202 spin_unlock_irq include/linux/spinlock.h:401 [inline] sync_print_obj drivers/dma-buf/sync_debug.c:118 [inline] sync_info_debugfs_show+0xf4/0x210 drivers/dma-buf/sync_debug.c:153 seq_read_iter+0x4fd/0x12c0 fs/seq_file.c:230 seq_read+0x390/0x4d0 fs/seq_file.c:162 vfs_read+0x1d7/0xbd0 fs/read_write.c:474 ksys_read+0x12f/0x260 fs/read_write.c:619 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f532c87cee9 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:00007f532d5160c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 00007f532c9abf80 RCX: 00007f532c87cee9 RDX: 0000000000002020 RSI: 0000000020000a00 RDI: 0000000000000006 RBP: 00007f532c8c949e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f532c9abf80 R15: 00007ffc73178a68