================================ WARNING: inconsistent lock state 5.19.0-syzkaller-13930-g7ebfc85e2cd7 #0 Not tainted -------------------------------- inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage. syz-executor.2/25765 [HC0[0]:SC0[0]:HE0:SE1] takes: ffffffff8d522c38 (sync_timeline_list_lock){?...}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:374 [inline] ffffffff8d522c38 (sync_timeline_list_lock){?...}-{2:2}, at: sync_info_debugfs_show+0x90/0x510 drivers/dma-buf/sync_debug.c:147 {IN-HARDIRQ-W} state was registered at: lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5666 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162 sync_timeline_debug_remove+0x28/0x140 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+0x200/0x250 drivers/dma-buf/sw_sync.c:144 kref_put include/linux/kref.h:65 [inline] dma_fence_put include/linux/dma-fence.h:276 [inline] dma_fence_array_release+0x134/0x240 drivers/dma-buf/dma-fence-array.c:120 irq_work_single+0xd3/0x230 kernel/irq_work.c:211 irq_work_run_list kernel/irq_work.c:242 [inline] irq_work_run+0x189/0x350 kernel/irq_work.c:251 __sysvec_irq_work+0x62/0x70 arch/x86/kernel/irq_work.c:22 sysvec_irq_work+0x8c/0xb0 arch/x86/kernel/irq_work.c:17 asm_sysvec_irq_work+0x16/0x20 __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:160 [inline] _raw_spin_unlock_irq+0x25/0x40 kernel/locking/spinlock.c:202 spin_unlock_irq include/linux/spinlock.h:399 [inline] sw_sync_debugfs_release+0x14d/0x1d0 drivers/dma-buf/sw_sync.c:321 __fput+0x3b9/0x820 fs/file_table.c:320 task_work_run+0x146/0x1c0 kernel/task_work.c:177 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0x134/0x160 kernel/entry/common.c:169 exit_to_user_mode_prepare+0xad/0x110 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x2e/0x60 kernel/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x63/0xcd irq event stamp: 240 hardirqs last enabled at (239): [] mod_objcg_state+0x447/0x6b0 mm/memcontrol.c:3158 hardirqs last disabled at (240): [] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:117 [inline] hardirqs last disabled at (240): [] _raw_spin_lock_irq+0xa9/0x110 kernel/locking/spinlock.c:170 softirqs last enabled at (92): [] __irq_exit_rcu+0xec/0x170 kernel/softirq.c:650 softirqs last disabled at (59): [] __irq_exit_rcu+0xec/0x170 kernel/softirq.c:650 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.2/25765: #0: ffff8880208820e8 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0x242/0x2e0 fs/file.c:1036 #1: ffff888026ba9d58 (&p->lock){+.+.}-{3:3}, at: seq_read_iter+0xad/0xd30 fs/seq_file.c:182 #2: ffffffff8d522c38 (sync_timeline_list_lock){?...}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:374 [inline] #2: ffffffff8d522c38 (sync_timeline_list_lock){?...}-{2:2}, at: sync_info_debugfs_show+0x90/0x510 drivers/dma-buf/sync_debug.c:147 stack backtrace: CPU: 1 PID: 25765 Comm: syz-executor.2 Not tainted 5.19.0-syzkaller-13930-g7ebfc85e2cd7 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 mark_lock_irq+0xb2a/0xf10 mark_lock+0x21e/0x350 kernel/locking/lockdep.c:4632 mark_held_locks kernel/locking/lockdep.c:4234 [inline] __trace_hardirqs_on_caller kernel/locking/lockdep.c:4252 [inline] lockdep_hardirqs_on_prepare+0x280/0x7b0 kernel/locking/lockdep.c:4319 trace_hardirqs_on+0x34/0x40 kernel/trace/trace_preemptirq.c:49 __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:159 [inline] _raw_spin_unlock_irq+0x1f/0x40 kernel/locking/spinlock.c:202 spin_unlock_irq include/linux/spinlock.h:399 [inline] sync_print_obj drivers/dma-buf/sync_debug.c:118 [inline] sync_info_debugfs_show+0x17e/0x510 drivers/dma-buf/sync_debug.c:153 seq_read_iter+0x43a/0xd30 fs/seq_file.c:230 seq_read+0x287/0x380 fs/seq_file.c:162 vfs_read+0x2eb/0xbc0 fs/read_write.c:468 ksys_read+0x19b/0x2c0 fs/read_write.c:607 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fd2f1689279 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fd2f2772168 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 00007fd2f179bf80 RCX: 00007fd2f1689279 RDX: 000000000000205f RSI: 0000000020000340 RDI: 0000000000000004 RBP: 00007fd2f16e3189 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffe0c3d0b2f R14: 00007fd2f2772300 R15: 0000000000022000