[v5.15] UBSAN: shift-out-of-bounds in pcl726_attach

3 views
Skip to first unread message

syzbot

unread,
Jul 7, 2025, 11:45:24 PM7/7/25
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 3dea0e7f549e Linux 5.15.186
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1639728c580000
kernel config: https://syzkaller.appspot.com/x/.config?x=644ffcb58c0b09d3
dashboard link: https://syzkaller.appspot.com/bug?extid=2d6fd444c6491140f297
compiler: Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132), Debian LLD 20.1.7

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/3d73d6f07b0c/disk-3dea0e7f.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/4064de18c9e9/vmlinux-3dea0e7f.xz
kernel image: https://storage.googleapis.com/syzbot-assets/069c7b1e74a9/bzImage-3dea0e7f.xz

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

loop1: detected capacity change from 0 to 256
================================================================================
UBSAN: shift-out-of-bounds in drivers/comedi/drivers/pcl726.c:332:46
shift exponent -2147450880 is negative
CPU: 0 PID: 4534 Comm: syz.1.57 Not tainted 5.15.186-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call Trace:
<TASK>
dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106
ubsan_epilogue+0xa/0x30 lib/ubsan.c:151
__ubsan_handle_shift_out_of_bounds+0x37c/0x400 lib/ubsan.c:321
pcl726_attach+0xab5/0xd40 drivers/comedi/drivers/pcl726.c:332
comedi_device_attach+0x515/0x650 drivers/comedi/drivers.c:996
do_devconfig_ioctl drivers/comedi/comedi_fops.c:851 [inline]
comedi_unlocked_ioctl+0x5ec/0xe90 drivers/comedi/comedi_fops.c:2131
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:874 [inline]
__se_sys_ioctl+0xfa/0x170 fs/ioctl.c:860
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f37cf794929
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f37cd5fc038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f37cf9bbfa0 RCX: 00007f37cf794929
RDX: 0000200000000080 RSI: 0000000040946400 RDI: 0000000000000004
RBP: 00007f37cf816b39 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f37cf9bbfa0 R15: 00007ffd8734e648
</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

syzbot

unread,
Jul 8, 2025, 12:45:25 AM7/8/25
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 3dea0e7f549e Linux 5.15.186
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=14f4d28c580000
kernel config: https://syzkaller.appspot.com/x/.config?x=644ffcb58c0b09d3
dashboard link: https://syzkaller.appspot.com/bug?extid=2d6fd444c6491140f297
compiler: Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132), Debian LLD 20.1.7
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13e0df70580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14ed728c580000
================================================================================
UBSAN: shift-out-of-bounds in drivers/comedi/drivers/pcl726.c:332:46
shift exponent -2147450880 is negative
CPU: 0 PID: 4309 Comm: syz.0.16 Not tainted 5.15.186-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call Trace:
<TASK>
dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106
ubsan_epilogue+0xa/0x30 lib/ubsan.c:151
__ubsan_handle_shift_out_of_bounds+0x37c/0x400 lib/ubsan.c:321
pcl726_attach+0xab5/0xd40 drivers/comedi/drivers/pcl726.c:332
comedi_device_attach+0x515/0x650 drivers/comedi/drivers.c:996
do_devconfig_ioctl drivers/comedi/comedi_fops.c:851 [inline]
comedi_unlocked_ioctl+0x5ec/0xe90 drivers/comedi/comedi_fops.c:2131
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:874 [inline]
__se_sys_ioctl+0xfa/0x170 fs/ioctl.c:860
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fb9d998b929
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc8bd09cf8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fb9d9bb2fa0 RCX: 00007fb9d998b929
RDX: 0000200000000080 RSI: 0000000040946400 RDI: 0000000000000003
RBP: 00007fb9d9a0db39 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fb9d9bb2fa0 R14: 00007fb9d9bb2fa0 R15: 0000000000000003
</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.

syzbot

unread,
Oct 4, 2025, 11:31:03 PM10/4/25
to syzkaller...@googlegroups.com
syzbot suspects this issue was fixed by commit:

commit bab220b0bb5af652007e278e8e8357f952b0e1ea
Author: Edward Adam Davis <ead...@qq.com>
Date: Mon Jul 7 12:39:58 2025 +0000

comedi: pcl726: Prevent invalid irq number

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=112bc458580000
start commit: 3dea0e7f549e Linux 5.15.186
git tree: linux-5.15.y
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11f2df70580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1095c28c580000

If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: comedi: pcl726: Prevent invalid irq number

For information about bisection process see: https://goo.gl/tpsmEJ#bisection
Reply all
Reply to author
Forward
0 new messages