bisecting fixing commit since f71077a4d84bbe8c7b91b7db7c4ef815755ac5e3 building syzkaller on 3cd800e43d452c348a66ba475143831d94969a24 testing commit f71077a4d84bbe8c7b91b7db7c4ef815755ac5e3 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 0945edcc352c06b4047a5e01ac5f6674458dd99aaaab71238c8d817e276216cb run #0: basic kernel testing failed: BUG: program execution failed: executor NUM: EOF run #1: crashed: inconsistent lock state in sync_timeline_debug_remove run #2: crashed: inconsistent lock state in sync_timeline_debug_remove run #3: crashed: inconsistent lock state in sync_timeline_debug_remove run #4: crashed: inconsistent lock state in sync_timeline_debug_remove run #5: crashed: inconsistent lock state in sync_timeline_debug_remove run #6: crashed: inconsistent lock state in sync_timeline_debug_remove run #7: crashed: inconsistent lock state in sync_timeline_debug_remove run #8: crashed: inconsistent lock state in sync_timeline_debug_remove run #9: crashed: inconsistent lock state in sync_timeline_debug_remove run #10: crashed: inconsistent lock state in sync_timeline_debug_remove run #11: crashed: inconsistent lock state in sync_timeline_debug_remove run #12: crashed: inconsistent lock state in sync_timeline_debug_remove run #13: crashed: inconsistent lock state in sync_timeline_debug_remove run #14: crashed: inconsistent lock state in sync_timeline_debug_remove run #15: crashed: inconsistent lock state in sync_timeline_debug_remove run #16: crashed: inconsistent lock state in sync_timeline_debug_remove run #17: crashed: inconsistent lock state in sync_timeline_debug_remove run #18: crashed: inconsistent lock state in sync_timeline_debug_remove run #19: crashed: inconsistent lock state in sync_timeline_debug_remove testing current HEAD b253435746d9a4a701b5f09211b9c14d3370d0da testing commit b253435746d9a4a701b5f09211b9c14d3370d0da compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 3134c6cd96739b2db3ca59babac367c3cd9dfbb10852c756610f225c27ad4258 all runs: crashed: inconsistent lock state in sync_timeline_debug_remove revisions tested: 2, total time: 18m7.389263389s (build: 11m54.401483065s, test: 5m32.051747331s) the crash still happens on HEAD commit msg: Merge tag 'xtensa-20220416' of https://github.com/jcmvbkbc/linux-xtensa crash: inconsistent lock state in sync_timeline_debug_remove ================================ WARNING: inconsistent lock state 5.18.0-rc3-syzkaller #0 Not tainted -------------------------------- inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. syz-executor.0/3978 [HC1[1]:SC0[0]:HE0:SE1] takes: ffffffff8b8c2fb8 (sync_timeline_list_lock){?.+.}-{2:2}, at: sync_timeline_debug_remove+0x19/0x180 drivers/dma-buf/sync_debug.c:31 {HARDIRQ-ON-W} state was registered at: __trace_hardirqs_on_caller kernel/locking/lockdep.c:4226 [inline] lockdep_hardirqs_on_prepare kernel/locking/lockdep.c:4294 [inline] lockdep_hardirqs_on_prepare+0x135/0x400 kernel/locking/lockdep.c:4246 trace_hardirqs_on+0x1c/0x140 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+0xd4/0x1d0 drivers/dma-buf/sync_debug.c:153 seq_read_iter+0x40b/0x1040 fs/seq_file.c:230 seq_read+0x294/0x410 fs/seq_file.c:162 vfs_read+0x15f/0x4b0 fs/read_write.c:480 ksys_read+0xee/0x1c0 fs/read_write.c:620 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0x80 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae irq event stamp: 5008 hardirqs last enabled at (5007): [] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:159 [inline] hardirqs last enabled at (5007): [] _raw_spin_unlock_irq+0x1f/0x40 kernel/locking/spinlock.c:202 hardirqs last disabled at (5008): [] sysvec_irq_work+0xb/0xc0 arch/x86/kernel/irq_work.c:17 softirqs last enabled at (0): [] copy_process+0x1d09/0x68e0 kernel/fork.c:2179 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 *** no locks held by syz-executor.0/3978. stack backtrace: CPU: 1 PID: 3978 Comm: syz-executor.0 Not tainted 5.18.0-rc3-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x57/0x7d lib/dump_stack.c:106 print_usage_bug kernel/locking/lockdep.c:4609 [inline] valid_state kernel/locking/lockdep.c:3947 [inline] mark_lock_irq kernel/locking/lockdep.c:4150 [inline] mark_lock.part.0.cold+0x5d/0xd8 kernel/locking/lockdep.c:4607 mark_lock kernel/locking/lockdep.c:4571 [inline] mark_usage kernel/locking/lockdep.c:4499 [inline] __lock_acquire+0x1471/0x5660 kernel/locking/lockdep.c:4983 lock_acquire kernel/locking/lockdep.c:5641 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5606 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x39/0x50 kernel/locking/spinlock.c:162 sync_timeline_debug_remove+0x19/0x180 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+0x1f6/0x2c0 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+0x170/0x240 drivers/dma-buf/dma-fence-array.c:120 irq_work_single+0x106/0x220 kernel/irq_work.c:211 irq_work_run_list kernel/irq_work.c:242 [inline] irq_work_run_list+0x6a/0x90 kernel/irq_work.c:225 irq_work_run+0x4f/0xd0 kernel/irq_work.c:251 __sysvec_irq_work+0x95/0x3d0 arch/x86/kernel/irq_work.c:22 sysvec_irq_work+0x8e/0xc0 arch/x86/kernel/irq_work.c:17 asm_sysvec_irq_work+0x12/0x20 arch/x86/include/asm/idtentry.h:671 RIP: 0010:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:160 [inline] RIP: 0010:_raw_spin_unlock_irq+0x25/0x40 kernel/locking/spinlock.c:202 Code: 0f 1f 44 00 00 55 48 8b 74 24 08 48 89 fd 48 83 c7 18 e8 ce b9 c4 f8 48 89 ef e8 16 39 c5 f8 e8 51 f1 e1 f8 fb bf 01 00 00 00 86 5a b8 f8 65 8b 05 9f 2f 72 77 85 c0 74 02 5d c3 e8 eb fa 6f RSP: 0018:ffffc90001b2fa68 EFLAGS: 00000202 RAX: 000000000000138f RBX: ffff88801d278d00 RCX: 1ffffffff194d709 RDX: 0000000000000000 RSI: ffffffff88eb90a0 RDI: 0000000000000001 RBP: ffff88801d278d50 R08: 0000000000000001 R09: 0000000000000001 R10: ffffed1003a4f1aa R11: 0000000000000001 R12: dffffc0000000000 R13: ffff88801d278d00 R14: ffff88801d278d50 R15: ffff88807e5bbd30 spin_unlock_irq include/linux/spinlock.h:399 [inline] sw_sync_debugfs_release+0x134/0x1e0 drivers/dma-buf/sw_sync.c:321 __fput+0x1f5/0x8c0 fs/file_table.c:317 task_work_run+0xc0/0x160 kernel/task_work.c:164 exit_task_work include/linux/task_work.h:37 [inline] do_exit+0x986/0x2470 kernel/exit.c:795 do_group_exit+0xb2/0x2a0 kernel/exit.c:925 get_signal+0x1c12/0x1e50 kernel/signal.c:2864 arch_do_signal_or_restart+0x88/0x1a10 arch/x86/kernel/signal.c:867 exit_to_user_mode_loop kernel/entry/common.c:166 [inline] exit_to_user_mode_prepare+0x15f/0x250 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:294 do_syscall_64+0x42/0x80 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f4ccc689059 Code: Unable to access opcode bytes at RIP 0x7f4ccc68902f. RSP: 002b:00007f4ccd71e218 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: 0000000000000001 RBX: 00007f4ccc79bf68 RCX: 00007f4ccc689059 RDX: 00000000000f4240 RSI: 0000000000000081 RDI: 00007f4ccc79bf6c RBP: 00007f4ccc79bf60 R08: 00007ffc9c1d5080 R09: 0000000000000000 R10: 0000000000000008 R11: 0000000000000246 R12: 00007f4ccc79bf6c R13: 00007ffc9c1c32af R14: 00007f4ccd71e300 R15: 0000000000022000 ---------------- Code disassembly (best guess): 0: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 5: 55 push %rbp 6: 48 8b 74 24 08 mov 0x8(%rsp),%rsi b: 48 89 fd mov %rdi,%rbp e: 48 83 c7 18 add $0x18,%rdi 12: e8 ce b9 c4 f8 callq 0xf8c4b9e5 17: 48 89 ef mov %rbp,%rdi 1a: e8 16 39 c5 f8 callq 0xf8c53935 1f: e8 51 f1 e1 f8 callq 0xf8e1f175 24: fb sti 25: bf 01 00 00 00 mov $0x1,%edi * 2a: e8 86 5a b8 f8 callq 0xf8b85ab5 <-- trapping instruction 2f: 65 8b 05 9f 2f 72 77 mov %gs:0x77722f9f(%rip),%eax # 0x77722fd5 36: 85 c0 test %eax,%eax 38: 74 02 je 0x3c 3a: 5d pop %rbp 3b: c3 retq 3c: e8 .byte 0xe8 3d: eb fa jmp 0x39 3f: 6f outsl %ds:(%rsi),(%dx)