================================ WARNING: inconsistent lock state syzkaller #0 Tainted: G L -------------------------------- inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage. syz.1.3671/24780 [HC0[0]:SC0[2]:HE1:SE0] takes: ffff888031f49868 (&dev->spinlock){?.-.}-{3:3}, at: spin_lock_bh include/linux/spinlock.h:347 [inline] ffff888031f49868 (&dev->spinlock){?.-.}-{3:3}, at: waveform_ao_cancel+0x8d/0x120 drivers/comedi/drivers/comedi_test.c:628 {IN-HARDIRQ-W} state was registered at: lock_acquire+0xf0/0x2e0 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:154 spin_lock include/linux/spinlock.h:341 [inline] das16m1_interrupt+0x5e/0x180 drivers/comedi/drivers/das16m1.c:460 __handle_irq_event_percpu+0x227/0x9e0 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/0xa10 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 orc_ip arch/x86/kernel/unwind_orc.c:81 [inline] __orc_find arch/x86/kernel/unwind_orc.c:103 [inline] orc_find arch/x86/kernel/unwind_orc.c:238 [inline] unwind_next_frame+0x505/0x23c0 arch/x86/kernel/unwind_orc.c:510 arch_stack_walk+0x11b/0x150 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0xa9/0x100 kernel/stacktrace.c:122 kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 unpoison_slab_object mm/kasan/common.c:340 [inline] __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:366 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4501 [inline] slab_alloc_node mm/slub.c:4830 [inline] kmem_cache_alloc_noprof+0x2bc/0x650 mm/slub.c:4837 lsm_inode_alloc security/security.c:228 [inline] security_inode_alloc+0x39/0x310 security/security.c:1189 inode_init_always_gfp+0x9ed/0xdc0 fs/inode.c:307 inode_init_always include/linux/fs.h:2922 [inline] alloc_inode+0x82/0x1b0 fs/inode.c:354 new_inode_pseudo include/linux/fs.h:3003 [inline] sock_alloc net/socket.c:637 [inline] __sock_create+0x11e/0x960 net/socket.c:1584 sock_create net/socket.c:1678 [inline] __sys_socket_create net/socket.c:1715 [inline] __sys_socket+0xd9/0x310 net/socket.c:1762 __do_sys_socket net/socket.c:1776 [inline] __se_sys_socket net/socket.c:1774 [inline] __x64_sys_socket+0x7a/0x90 net/socket.c:1774 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x14d/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f irq event stamp: 1106 hardirqs last enabled at (1105): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:178 [inline] hardirqs last enabled at (1105): [] _raw_spin_unlock_irqrestore+0x30/0x80 kernel/locking/spinlock.c:194 hardirqs last disabled at (1104): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:130 [inline] hardirqs last disabled at (1104): [] _raw_spin_lock_irqsave+0x1a/0x60 kernel/locking/spinlock.c:162 softirqs last enabled at (634): [] local_bh_disable include/linux/bottom_half.h:20 [inline] softirqs last enabled at (634): [] fpregs_lock arch/x86/include/asm/fpu/api.h:69 [inline] softirqs last enabled at (634): [] fpu_clone+0x353/0xbc0 arch/x86/kernel/fpu/core.c:715 softirqs last disabled at (1106): [] spin_lock_bh include/linux/spinlock.h:347 [inline] softirqs last disabled at (1106): [] waveform_ao_cancel+0x8d/0x120 drivers/comedi/drivers/comedi_test.c:628 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&dev->spinlock); lock(&dev->spinlock); *** DEADLOCK *** 1 lock held by syz.1.3671/24780: #0: ffff888031f498f8 (&dev->mutex#4){+.+.}-{4:4}, at: comedi_close+0x70/0x5e0 drivers/comedi/comedi_fops.c:3029 stack backtrace: CPU: 1 UID: 0 PID: 24780 Comm: syz.1.3671 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:4662 [inline] __lock_acquire+0x9d0/0x2cf0 kernel/locking/lockdep.c:5191 lock_acquire+0xf0/0x2e0 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:178 spin_lock_bh include/linux/spinlock.h:347 [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:226 [inline] syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:256 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:325 [inline] do_syscall_64+0x32d/0xf80 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f5d61f9bf79 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffca6e87cf8 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4 RAX: 0000000000000000 RBX: 00007ffca6e87de0 RCX: 00007f5d61f9bf79 RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003 RBP: 000000000008029f R08: 0000000000000001 R09: 0000000000000000 R10: 0000001b2f320000 R11: 0000000000000246 R12: 00007ffca6e87e20 R13: 00007f5d62215fac R14: 00000000000802d5 R15: 00007f5d62215fa0