syzbot


inconsistent lock state in waveform_ao_cancel

Status: closed as dup on 2026/02/25 13:00
Subsystems: comedi
[Documentation on labels]
Reported-by: syzbot+d9aa9a4d32dc3976468e@syzkaller.appspotmail.com
First crash: 36d, last: 29d
Duplicate of
Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported
inconsistent lock state in das16m1_interrupt comedi 4 12 1d08h 35d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [comedi?] inconsistent lock state in waveform_ao_cancel 0 (2) 2026/02/25 13:00

Sample crash report:
================================
WARNING: inconsistent lock state
syzkaller #0 Tainted: G             L     
--------------------------------
inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage.
syz.1.6616/27531 [HC0[0]:SC0[2]:HE1:SE0] takes:
ffff88803146a068 (&dev->spinlock){?...}-{3:3}, at: spin_lock_bh include/linux/spinlock.h:347 [inline]
ffff88803146a068 (&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
  schedule_debug kernel/sched/core.c:5854 [inline]
  __schedule+0x17c/0x5340 kernel/sched/core.c:6783
  preempt_schedule_common+0x82/0xd0 kernel/sched/core.c:7091
  preempt_schedule_thunk+0x16/0x30 arch/x86/entry/thunk.S:12
  __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:179 [inline]
  _raw_spin_unlock_irqrestore+0x74/0x80 kernel/locking/spinlock.c:194
  spin_unlock_irqrestore include/linux/spinlock.h:407 [inline]
  __wake_up_common_lock+0x190/0x1f0 kernel/sched/wait.c:127
  sock_def_readable+0x1eb/0x580 net/core/sock.c:3611
  __netlink_sendskb net/netlink/af_netlink.c:1263 [inline]
  netlink_sendskb+0xa1/0x140 net/netlink/af_netlink.c:1269
  netlink_unicast+0x3a3/0x9b0 net/netlink/af_netlink.c:1359
  netlink_sendmsg+0x813/0xb40 net/netlink/af_netlink.c:1894
  sock_sendmsg_nosec+0x18f/0x1d0 net/socket.c:737
  __sock_sendmsg net/socket.c:752 [inline]
  ____sys_sendmsg+0x589/0x8c0 net/socket.c:2610
  ___sys_sendmsg+0x2a5/0x360 net/socket.c:2664
  __sys_sendmsg net/socket.c:2696 [inline]
  __do_sys_sendmsg net/socket.c:2701 [inline]
  __se_sys_sendmsg net/socket.c:2699 [inline]
  __x64_sys_sendmsg+0x1bd/0x2a0 net/socket.c:2699
  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: 1928
hardirqs last  enabled at (1927): [<ffffffff8bbadf2e>] irqentry_exit+0x59e/0x620 kernel/entry/common.c:242
hardirqs last disabled at (1925): [<ffffffff818859a8>] handle_softirqs+0x5c8/0x870 kernel/softirq.c:641
softirqs last  enabled at (1926): [<ffffffff81885e1f>] __do_softirq kernel/softirq.c:660 [inline]
softirqs last  enabled at (1926): [<ffffffff81885e1f>] invoke_softirq kernel/softirq.c:496 [inline]
softirqs last  enabled at (1926): [<ffffffff81885e1f>] __irq_exit_rcu+0x5f/0x150 kernel/softirq.c:727
softirqs last disabled at (1928): [<ffffffff8910d49d>] spin_lock_bh include/linux/spinlock.h:347 [inline]
softirqs last disabled at (1928): [<ffffffff8910d49d>] 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);
  <Interrupt>
    lock(&dev->spinlock);

 *** DEADLOCK ***

1 lock held by syz.1.6616/27531:
 #0: ffff88803146a0f8 (&dev->mutex#4){+.+.}-{4:4}, at: comedi_close+0x70/0x5e0 drivers/comedi/comedi_fops.c:3029

stack backtrace:
CPU: 0 UID: 0 PID: 27531 Comm: syz.1.6616 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:
 <TASK>
 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:0x7f8ff279c629
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:00007fff7f5cbbd8 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4
RAX: 0000000000000000 RBX: 00007fff7f5cbcc0 RCX: 00007f8ff279c629
RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003
RBP: 0000000000130a66 R08: 0000000000000001 R09: 0000000000000000
R10: 0000001b33220000 R11: 0000000000000246 R12: 00007fff7f5cbd00
R13: 00007f8ff2a15fac R14: 0000000000130aa2 R15: 00007f8ff2a15fa0
 </TASK>

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/02/20 12:20 linux-next 44982d352c33 17d780d6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-rust-kasan-gce inconsistent lock state in waveform_ao_cancel
2026/02/19 12:04 linux-next 50f68cc7be0a 746545b8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-rust-kasan-gce inconsistent lock state in waveform_ao_cancel
2026/02/17 08:27 linux-next 350adaf7fde9 e439b951 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-rust-kasan-gce inconsistent lock state in waveform_ao_cancel
2026/02/13 00:47 linux-next af98e93c5c39 504cb1bf .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-rust-kasan-gce inconsistent lock state in waveform_ao_cancel
* Struck through repros no longer work on HEAD.