Re: [syzbot] [comedi?] possible deadlock in comedi_do_insn (2)
From: syzbot
Date: Mon Sep 14 2026 - 16:02:20 EST
syzbot has found a reproducer for the following issue on:
HEAD commit: 704340f1cd0d Merge tag 'x86_urgent_for_7.3-rc4' of git://g..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=165c9901580000
kernel config: https://syzkaller.appspot.com/x/.config?x=8c5c3949d762a91f
dashboard link: https://syzkaller.appspot.com/bug?extid=acd959f649966559199c
compiler: gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=12aa2471580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15f26601580000
Downloadable assets:
disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/d900f083ada3/non_bootable_disk-704340f1.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/e02afc1c5927/vmlinux-704340f1.xz
kernel image: https://storage.googleapis.com/syzbot-assets/09cb4a8b3309/bzImage-704340f1.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+acd959f649966559199c@xxxxxxxxxxxxxxxxxxxxxxxxx
comedi comedi0: comedi_test: 1000000 microvolt, 100000 microsecond waveform attached
comedi comedi1: comedi_bond: 0:2 attached, 32 channels from 1 devices
============================================
WARNING: possible recursive locking detected
syzkaller #0 Not tainted
--------------------------------------------
syz.0.17/5908 is trying to acquire lock:
ffff8880339978f0 (&dev->mutex#4){+.+.}-{4:4}, at: comedi_do_insn+0x2e/0x360 drivers/comedi/kcomedilib/kcomedilib_main.c:183
but task is already holding lock:
ffff8880339970f0 (&dev->mutex#4){+.+.}-{4:4}, at: comedi_unlocked_ioctl+0x180/0x3310 drivers/comedi/comedi_fops.c:2290
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----
lock(&dev->mutex#4);
lock(&dev->mutex#4);
*** DEADLOCK ***
May be due to missing lock nesting notation
locks held by syz.0.17/5908: 1, last CPU#1:
#0: ffff8880339970f0 (&dev->mutex#4){+.+.}-{4:4}, at: comedi_unlocked_ioctl+0x180/0x3310 drivers/comedi/comedi_fops.c:2290
stack backtrace:
CPU: 1 UID: 0 PID: 5908 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120
print_deadlock_bug.cold+0xbd/0xca kernel/locking/lockdep.c:3085
check_deadlock kernel/locking/lockdep.c:3137 [inline]
validate_chain kernel/locking/lockdep.c:3939 [inline]
__lock_acquire+0x13f4/0x1f40 kernel/locking/lockdep.c:5288
lock_acquire kernel/locking/lockdep.c:5942 [inline]
lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899
__mutex_lock_common kernel/locking/mutex.c:646 [inline]
__mutex_lock+0x1a4/0x1bd0 kernel/locking/mutex.c:821
comedi_do_insn+0x2e/0x360 drivers/comedi/kcomedilib/kcomedilib_main.c:183
comedi_dio_bitfield2+0x3c0/0x420 drivers/comedi/kcomedilib/kcomedilib_main.c:314
bonding_dio_insn_bits+0x2b9/0x570 drivers/comedi/drivers/comedi_bond.c:100
parse_insn+0x1326/0x19f0 drivers/comedi/comedi_fops.c:1613
do_insn_ioctl+0x152/0x4e0 drivers/comedi/comedi_fops.c:1790
comedi_unlocked_ioctl+0xf68/0x3310 drivers/comedi/comedi_fops.c:2422
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:597 [inline]
__se_sys_ioctl fs/ioctl.c:583 [inline]
__x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f9368f9e159
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:00007ffcaf8c9638 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f9369225fa0 RCX: 00007f9368f9e159
RDX: 0000200000000400 RSI: 000000008028640c RDI: 0000000000000004
RBP: 00007f936903503b R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f9369225fac R14: 00007f9369225fa0 R15: 00007f9369225fa0
</TASK>
---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.