syzbot


UBSAN: shift-out-of-bounds in pcl726_attach

Status: fixed on 2025/10/06 10:35
Reported-by: syzbot+f2674644db6e7a819be9@syzkaller.appspotmail.com
Fix commit: 5a33d07c94ba comedi: pcl726: Prevent invalid irq number
First crash: 105d, last: 77d
Fix bisection: fixed by (bisect log) :
commit 5a33d07c94ba91306093e823112a7aa9727549f6
Author: Edward Adam Davis <eadavis@qq.com>
Date: Mon Jul 7 12:39:58 2025 +0000

  comedi: pcl726: Prevent invalid irq number

  
Bug presence (1)
Date Name Commit Repro Result
2025/09/28 upstream (ToT) 51a24b7deaae C Didn't crash
Similar bugs (3)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 UBSAN: shift-out-of-bounds in pcl726_attach origin:upstream -1 C done 19 77d 128d 2/3 upstream: reported C repro on 2025/07/08 03:45
linux-6.6 UBSAN: shift-out-of-bounds in pcl726_attach origin:upstream -1 C done 17 77d 105d 2/2 fixed on 2025/10/06 10:09
upstream UBSAN: shift-out-of-bounds in pcl726_attach comedi -1 C 318 82d 131d 29/29 fixed on 2025/10/09 01:15

Sample crash report:
================================================================================
UBSAN: shift-out-of-bounds in drivers/comedi/drivers/pcl726.c:331:46
shift exponent -4 is negative
CPU: 1 PID: 4410 Comm: syz.1.11 Not tainted 6.1.148-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x168/0x22e 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:331
 comedi_device_attach+0x515/0x650 drivers/comedi/drivers.c:998
 do_devconfig_ioctl drivers/comedi/comedi_fops.c:851 [inline]
 comedi_unlocked_ioctl+0x5ec/0xf20 drivers/comedi/comedi_fops.c:2151
 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:51 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fb934d8ebe9
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:00007fb935b5e038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fb934fb5fa0 RCX: 00007fb934d8ebe9
RDX: 00002000000005c0 RSI: 0000000040946400 RDI: 0000000000000003
RBP: 00007fb934e11e19 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fb934fb6038 R14: 00007fb934fb5fa0 R15: 00007ffd365f7a68
 </TASK>
================================================================================

Crashes (16):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/08/28 02:24 linux-6.1.y 0bc96de781b4 e12e5ba4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan UBSAN: shift-out-of-bounds in pcl726_attach
2025/08/28 02:22 linux-6.1.y 0bc96de781b4 e12e5ba4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan UBSAN: shift-out-of-bounds in pcl726_attach
2025/08/23 04:55 linux-6.1.y 0bc96de781b4 bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan UBSAN: shift-out-of-bounds in pcl726_attach
2025/08/23 04:55 linux-6.1.y 0bc96de781b4 bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan UBSAN: shift-out-of-bounds in pcl726_attach
2025/08/19 11:36 linux-6.1.y 0bc96de781b4 523f460e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan UBSAN: shift-out-of-bounds in pcl726_attach
2025/08/19 11:35 linux-6.1.y 0bc96de781b4 523f460e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan UBSAN: shift-out-of-bounds in pcl726_attach
2025/08/06 21:08 linux-6.1.y 3594f306da12 ffe1dd46 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan UBSAN: shift-out-of-bounds in pcl726_attach
2025/08/06 21:08 linux-6.1.y 3594f306da12 ffe1dd46 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan UBSAN: shift-out-of-bounds in pcl726_attach
2025/08/06 08:37 linux-6.1.y 3594f306da12 ffe1dd46 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan UBSAN: shift-out-of-bounds in pcl726_attach
2025/08/06 08:37 linux-6.1.y 3594f306da12 ffe1dd46 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan UBSAN: shift-out-of-bounds in pcl726_attach
2025/08/06 08:34 linux-6.1.y 3594f306da12 ffe1dd46 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan UBSAN: shift-out-of-bounds in pcl726_attach
2025/08/06 08:34 linux-6.1.y 3594f306da12 ffe1dd46 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan UBSAN: shift-out-of-bounds in pcl726_attach
2025/07/31 13:56 linux-6.1.y 3594f306da12 f8f2b4da .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan UBSAN: shift-out-of-bounds in pcl726_attach
2025/07/31 13:30 linux-6.1.y 3594f306da12 f8f2b4da .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan UBSAN: shift-out-of-bounds in pcl726_attach
2025/07/31 13:06 linux-6.1.y 3594f306da12 f8f2b4da .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan UBSAN: shift-out-of-bounds in pcl726_attach
2025/07/31 13:06 linux-6.1.y 3594f306da12 f8f2b4da .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan UBSAN: shift-out-of-bounds in pcl726_attach
* Struck through repros no longer work on HEAD.