================================ WARNING: inconsistent lock state 6.7.0-rc7-syzkaller-00029-g8735c7c84d1b #0 Not tainted -------------------------------- inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage. syz-executor.0/26727 [HC0[0]:SC0[0]:HE0:SE1] takes: ffffffff8ddfc2d8 (sync_timeline_list_lock){?...}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:376 [inline] ffffffff8ddfc2d8 (sync_timeline_list_lock){?...}-{2:2}, at: sync_info_debugfs_show+0x31/0x200 drivers/dma-buf/sync_debug.c:147 {IN-HARDIRQ-W} state was registered at: lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1ae/0x520 kernel/locking/lockdep.c:5719 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x50 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:104 [inline] kref_put include/linux/kref.h:65 [inline] sync_timeline_put drivers/dma-buf/sw_sync.c:116 [inline] timeline_fence_release+0x262/0x340 drivers/dma-buf/sw_sync.c:144 dma_fence_release+0x2f3/0x510 drivers/dma-buf/dma-fence.c:560 kref_put include/linux/kref.h:65 [inline] dma_fence_put include/linux/dma-fence.h:296 [inline] dma_fence_put include/linux/dma-fence.h:293 [inline] dma_fence_array_release+0x1fa/0x2e0 drivers/dma-buf/dma-fence-array.c:120 dma_fence_release+0x2f3/0x510 drivers/dma-buf/dma-fence.c:560 kref_put include/linux/kref.h:65 [inline] dma_fence_put include/linux/dma-fence.h:296 [inline] dma_fence_put include/linux/dma-fence.h:293 [inline] irq_dma_fence_array_work+0xa9/0xd0 drivers/dma-buf/dma-fence-array.c:52 irq_work_single+0x1b5/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+0x82/0x3a0 arch/x86/kernel/irq_work.c:22 sysvec_irq_work+0x90/0xb0 arch/x86/kernel/irq_work.c:17 asm_sysvec_irq_work+0x1a/0x20 arch/x86/include/asm/idtentry.h:674 __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:321 __fput+0x270/0xb70 fs/file_table.c:394 task_work_run+0x14d/0x240 kernel/task_work.c:180 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xa8a/0x2ad0 kernel/exit.c:869 do_group_exit+0xd4/0x2a0 kernel/exit.c:1018 get_signal+0x23b5/0x2790 kernel/signal.c:2904 arch_do_signal_or_restart+0x90/0x7f0 arch/x86/kernel/signal.c:309 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x121/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1e/0x60 kernel/entry/common.c:296 do_syscall_64+0x4d/0x110 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x63/0x6b irq event stamp: 112 hardirqs last enabled at (111): [] mod_objcg_state+0x467/0x770 mm/memcontrol.c:3373 hardirqs last disabled at (112): [] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:117 [inline] hardirqs last disabled at (112): [] _raw_spin_lock_irq+0x45/0x50 kernel/locking/spinlock.c:170 softirqs last enabled at (0): [] copy_process+0x2198/0x73f0 kernel/fork.c:2448 softirqs last disabled at (0): [<0000000000000000>] 0x0 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(sync_timeline_list_lock); lock(sync_timeline_list_lock); *** DEADLOCK *** 2 locks held by syz-executor.0/26727: #0: ffff88804b6b9c30 (&p->lock){+.+.}-{3:3}, at: seq_read_iter+0xda/0x1280 fs/seq_file.c:182 #1: ffffffff8ddfc2d8 (sync_timeline_list_lock){?...}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:376 [inline] #1: ffffffff8ddfc2d8 (sync_timeline_list_lock){?...}-{2:2}, at: sync_info_debugfs_show+0x31/0x200 drivers/dma-buf/sync_debug.c:147 stack backtrace: CPU: 1 PID: 26727 Comm: syz-executor.0 Not tainted 6.7.0-rc7-syzkaller-00029-g8735c7c84d1b #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 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+0x91a/0xc50 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 kernel/locking/lockdep.c:4359 [inline] lockdep_hardirqs_on_prepare+0x139/0x420 kernel/locking/lockdep.c:4311 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+0xef/0x200 drivers/dma-buf/sync_debug.c:153 traverse.part.0.constprop.0+0xff/0x630 fs/seq_file.c:111 traverse fs/seq_file.c:98 [inline] seq_read_iter+0x915/0x1280 fs/seq_file.c:195 seq_read+0x196/0x240 fs/seq_file.c:162 vfs_read+0x1ce/0x8f0 fs/read_write.c:468 ksys_pread64 fs/read_write.c:665 [inline] __do_sys_pread64 fs/read_write.c:675 [inline] __se_sys_pread64 fs/read_write.c:672 [inline] __x64_sys_pread64+0x1fa/0x250 fs/read_write.c:672 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7fd68f87cce9 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:00007fd6905ba0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000011 RAX: ffffffffffffffda RBX: 00007fd68f99bf80 RCX: 00007fd68f87cce9 RDX: 000000000000fe95 RSI: 0000000000000000 RDI: 0000000000000003 RBP: 00007fd68f8c947a R08: 0000000000000000 R09: 0000000000000000 R10: 0000002000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fd68f99bf80 R15: 00007ffcfa84c898