================================ WARNING: inconsistent lock state syzkaller #0 Tainted: G L -------------------------------- inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. syz.1.13833/12253 [HC1[1]:SC0[0]:HE0:SE1] takes: ffff8880318a4868 (&dev->spinlock){?...}-{3:3}, at: spin_lock include/linux/spinlock.h:342 [inline] ffff8880318a4868 (&dev->spinlock){?...}-{3:3}, at: das16m1_interrupt+0x5e/0x180 drivers/comedi/drivers/das16m1.c:460 {HARDIRQ-ON-W} state was registered at: lock_acquire+0x106/0x350 kernel/locking/lockdep.c:5868 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:150 [inline] _raw_spin_lock_bh+0x36/0x50 kernel/locking/spinlock.c:182 spin_lock_bh include/linux/spinlock.h:348 [inline] waveform_ao_cancel+0x8d/0x120 drivers/comedi/drivers/comedi_test.c:628 do_cancel drivers/comedi/comedi_fops.c:818 [inline] comedi_close+0x27e/0x5e0 drivers/comedi/comedi_fops.c:3036 __fput+0x44f/0xa70 fs/file_table.c:469 task_work_run+0x1d9/0x270 kernel/task_work.c:233 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] __exit_to_user_mode_loop kernel/entry/common.c:67 [inline] exit_to_user_mode_loop+0xed/0x480 kernel/entry/common.c:98 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:238 [inline] syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:269 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:328 [inline] do_syscall_64+0x33e/0xf80 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f irq event stamp: 135030 hardirqs last enabled at (135029): [] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:187 [inline] hardirqs last enabled at (135029): [] _raw_spin_unlock_irq+0x23/0x50 kernel/locking/spinlock.c:206 hardirqs last disabled at (135030): [] common_interrupt+0x13/0xe0 arch/x86/kernel/irq.c:326 softirqs last enabled at (133902): [] __do_softirq kernel/softirq.c:656 [inline] softirqs last enabled at (133902): [] invoke_softirq kernel/softirq.c:496 [inline] softirqs last enabled at (133902): [] __irq_exit_rcu+0xca/0x220 kernel/softirq.c:735 softirqs last disabled at (133891): [] __do_softirq kernel/softirq.c:656 [inline] softirqs last disabled at (133891): [] invoke_softirq kernel/softirq.c:496 [inline] softirqs last disabled at (133891): [] __irq_exit_rcu+0xca/0x220 kernel/softirq.c:735 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&dev->spinlock); lock(&dev->spinlock); *** DEADLOCK *** 3 locks held by syz.1.13833/12253: #0: ffff88801be8a410 (sb_writers#5){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2718 [inline] #0: ffff88801be8a410 (sb_writers#5){.+.+}-{0:0}, at: vfs_write+0x227/0xb90 fs/read_write.c:684 #1: ffff88807fce45e0 (&sb->s_type->i_mutex_key#15){++++}-{4:4}, at: inode_lock include/linux/fs.h:1028 [inline] #1: ffff88807fce45e0 (&sb->s_type->i_mutex_key#15){++++}-{4:4}, at: shmem_file_write_iter+0x7f/0x120 mm/shmem.c:3456 #2: ffffffff8e75d0e0 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:312 [inline] #2: ffffffff8e75d0e0 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:850 [inline] #2: ffffffff8e75d0e0 (rcu_read_lock){....}-{1:3}, at: filemap_get_entry+0xcd/0x3f0 mm/filemap.c:1898 stack backtrace: CPU: 0 UID: 0 PID: 12253 Comm: syz.1.13833 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2026 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_usage_bug+0x28b/0x2e0 kernel/locking/lockdep.c:4042 valid_state kernel/locking/lockdep.c:4056 [inline] mark_lock_irq+0x410/0x420 kernel/locking/lockdep.c:-1 mark_lock+0x115/0x190 kernel/locking/lockdep.c:4753 mark_usage kernel/locking/lockdep.c:4639 [inline] __lock_acquire+0x661/0x2cf0 kernel/locking/lockdep.c:5191 lock_acquire+0x106/0x350 kernel/locking/lockdep.c:5868 __raw_spin_lock include/linux/spinlock_api_smp.h:158 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:158 spin_lock include/linux/spinlock.h:342 [inline] das16m1_interrupt+0x5e/0x180 drivers/comedi/drivers/das16m1.c:460 __handle_irq_event_percpu+0x216/0x9a0 kernel/irq/handle.c:209 handle_irq_event_percpu kernel/irq/handle.c:246 [inline] handle_irq_event+0x8b/0x1e0 kernel/irq/handle.c:263 handle_edge_irq+0x23b/0x9f0 kernel/irq/chip.c:855 generic_handle_irq_desc include/linux/irqdesc.h:186 [inline] handle_irq arch/x86/kernel/irq.c:262 [inline] call_irq_handler arch/x86/kernel/irq.c:-1 [inline] __common_interrupt+0x141/0x1f0 arch/x86/kernel/irq.c:333 common_interrupt+0xb6/0xe0 arch/x86/kernel/irq.c:326 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:688 RIP: 0010:get_offset lib/xarray.c:147 [inline] RIP: 0010:xas_descend lib/xarray.c:207 [inline] RIP: 0010:xas_load+0x143/0x5b0 lib/xarray.c:246 Code: f6 4c 8b 3b bf 40 00 00 00 44 89 e6 e8 b6 9d 16 f6 41 80 fc 3f 48 8b 5c 24 18 48 8b 6c 24 40 0f 87 f1 03 00 00 e8 9d 9a 16 f6 <44> 89 e1 49 d3 ef 48 8b 44 24 10 42 80 3c 28 00 74 08 48 89 df e8 RSP: 0018:ffffc90005397850 EFLAGS: 00000246 RAX: ffffffff8baf80b3 RBX: ffffc90005397920 RCX: 0000000000080000 RDX: ffffc9001351d000 RSI: 000000000007ffff RDI: 0000000000080000 RBP: ffffc90005397938 R08: ffffffff8201657d R09: ffffffff8e75d0e0 R10: ffffc90005397940 R11: fffff52000a72f2b R12: 0000000000000006 R13: dffffc0000000000 R14: ffff88803d18e3c2 R15: 00000000000028a5 filemap_get_entry+0x181/0x3f0 mm/filemap.c:1901 shmem_get_folio_gfp+0x214/0x1420 mm/shmem.c:2488 shmem_get_folio mm/shmem.c:2658 [inline] shmem_write_begin+0x16c/0x330 mm/shmem.c:3291 generic_perform_write+0x2e2/0x8f0 mm/filemap.c:4325 shmem_file_write_iter+0xf8/0x120 mm/shmem.c:3466 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x61d/0xb90 fs/read_write.c:688 ksys_write+0x150/0x270 fs/read_write.c:740 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f757675cfce Code: 08 0f 85 a5 a8 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 80 00 00 00 00 48 83 ec 08 RSP: 002b:00007f757759eda8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f757759f6c0 RCX: 00007f757675cfce RDX: 0000000004000000 RSI: 00007f756c400000 RDI: 0000000000000003 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003 R13: 00007f757759eee0 R14: 00007f757759eea0 R15: 00007f756c400000 comedi comedi3: fifo overflow ---------------- Code disassembly (best guess): 0: f6 4c 8b 3b bf testb $0xbf,0x3b(%rbx,%rcx,4) 5: 40 00 00 rex add %al,(%rax) 8: 00 44 89 e6 add %al,-0x1a(%rcx,%rcx,4) c: e8 b6 9d 16 f6 call 0xf6169dc7 11: 41 80 fc 3f cmp $0x3f,%r12b 15: 48 8b 5c 24 18 mov 0x18(%rsp),%rbx 1a: 48 8b 6c 24 40 mov 0x40(%rsp),%rbp 1f: 0f 87 f1 03 00 00 ja 0x416 25: e8 9d 9a 16 f6 call 0xf6169ac7 * 2a: 44 89 e1 mov %r12d,%ecx <-- trapping instruction 2d: 49 d3 ef shr %cl,%r15 30: 48 8b 44 24 10 mov 0x10(%rsp),%rax 35: 42 80 3c 28 00 cmpb $0x0,(%rax,%r13,1) 3a: 74 08 je 0x44 3c: 48 89 df mov %rbx,%rdi 3f: e8 .byte 0xe8