[v6.1] possible deadlock in comedi_do_insn

0 views
Skip to first unread message

syzbot

unread,
10:10 AM (13 hours ago) 10:10 AM
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 8ce36b2849ef Linux 6.1.163
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=16c5f15a580000
kernel config: https://syzkaller.appspot.com/x/.config?x=f0605c5af04d7603
dashboard link: https://syzkaller.appspot.com/bug?extid=5ec04ed7eb585227420b
compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/25d3bb1313db/disk-8ce36b28.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/53d3c77e16da/vmlinux-8ce36b28.xz
kernel image: https://storage.googleapis.com/syzbot-assets/ca171a78e481/bzImage-8ce36b28.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+5ec04e...@syzkaller.appspotmail.com

============================================
WARNING: possible recursive locking detected
syzkaller #0 Not tainted
--------------------------------------------
syz.0.22258/25007 is trying to acquire lock:
ffff88802f0f80f8 (&dev->mutex#3){+.+.}-{3:3}, at: comedi_do_insn+0x38/0x3b0 drivers/comedi/kcomedilib/kcomedilib_main.c:73

but task is already holding lock:
ffff88814c8a70f8 (&dev->mutex#3){+.+.}-{3:3}, at: comedi_unlocked_ioctl+0x17a/0x1210 drivers/comedi/comedi_fops.c:2161

other info that might help us debug this:
Possible unsafe locking scenario:

CPU0
----
lock(&dev->mutex#3);
lock(&dev->mutex#3);

*** DEADLOCK ***

May be due to missing lock nesting notation

1 lock held by syz.0.22258/25007:
#0: ffff88814c8a70f8 (&dev->mutex#3){+.+.}-{3:3}, at: comedi_unlocked_ioctl+0x17a/0x1210 drivers/comedi/comedi_fops.c:2161

stack backtrace:
CPU: 0 PID: 25007 Comm: syz.0.22258 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2026
Call Trace:
<TASK>
dump_stack_lvl+0x188/0x24e lib/dump_stack.c:106
__lock_acquire+0x123e/0x7d10 kernel/locking/lockdep.c:-1
lock_acquire+0x1bb/0x4a0 kernel/locking/lockdep.c:5662
__mutex_lock_common kernel/locking/mutex.c:603 [inline]
__mutex_lock+0x12d/0xaf0 kernel/locking/mutex.c:747
comedi_do_insn+0x38/0x3b0 drivers/comedi/kcomedilib/kcomedilib_main.c:73
comedi_dio_bitfield2+0x2ea/0x3c0 drivers/comedi/kcomedilib/kcomedilib_main.c:204
bonding_dio_insn_bits+0x2c9/0x5e0 drivers/comedi/drivers/comedi_bond.c:100
insn_rw_emulate_bits+0x332/0x5e0 drivers/comedi/drivers.c:641
parse_insn+0x9f8/0x18a0 drivers/comedi/comedi_fops.c:1449
do_insn_ioctl+0x170/0x530 drivers/comedi/comedi_fops.c:1674
comedi_unlocked_ioctl+0xa36/0x1210 drivers/comedi/comedi_fops.c:2303
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl+0xfa/0x170 fs/ioctl.c:856
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f397b99bf79
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:00007f397c867028 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f397bc15fa0 RCX: 00007f397b99bf79
RDX: 0000200000000000 RSI: 000000008028640c RDI: 0000000000000003
RBP: 00007f397ba327e0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f397bc16038 R14: 00007f397bc15fa0 R15: 00007fff136183b8
</TASK>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup
Reply all
Reply to author
Forward
0 new messages