[syzbot] [kernel?] general protection fault in pcl818_ai_cancel

15 views
Skip to first unread message

syzbot

unread,
Jul 5, 2025, 6:41:28 AM7/5/25
to abb...@mev.co.uk, hswe...@visionengravers.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 26ffb3d6f02c Add linux-next specific files for 20250704
git tree: linux-next
console+strace: https://syzkaller.appspot.com/x/log.txt?x=1304cf70580000
kernel config: https://syzkaller.appspot.com/x/.config?x=8c567bd5a036e49d
dashboard link: https://syzkaller.appspot.com/bug?extid=fce5d9d5bd067d6fbe9b
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=11022c8c580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1704cf70580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/8d8ce9c14ce8/disk-26ffb3d6.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/4c33279b98ff/vmlinux-26ffb3d6.xz
kernel image: https://storage.googleapis.com/syzbot-assets/3c38b307a04c/bzImage-26ffb3d6.xz

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

comedi comedi0: pcl818: I/O port conflict (0x4,16)
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000005: 0000 [#1] SMP KASAN PTI
KASAN: null-ptr-deref in range [0x0000000000000028-0x000000000000002f]
CPU: 0 UID: 0 PID: 5848 Comm: syz-executor349 Not tainted 6.16.0-rc4-next-20250704-syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
RIP: 0010:pcl818_ai_cancel+0x69/0x3f0 drivers/comedi/drivers/pcl818.c:762
Code: 8b 1b 48 89 d8 48 c1 e8 03 42 80 3c 28 00 74 08 48 89 df e8 79 ca 34 f9 48 8b 03 48 89 04 24 49 83 c4 28 4c 89 e0 48 c1 e8 03 <42> 80 3c 28 00 74 08 4c 89 e7 e8 58 ca 34 f9 4d 8b 24 24 48 83 c3
RSP: 0018:ffffc90003ee79f0 EFLAGS: 00010206
RAX: 0000000000000005 RBX: ffff88802854df00 RCX: ffff888033bd3c00
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff88802f550000
RBP: 0000000000000001 R08: ffff88802f55012f R09: 1ffff11005eaa025
R10: dffffc0000000000 R11: ffffffff88efad60 R12: 0000000000000028
R13: dffffc0000000000 R14: ffff88802f550000 R15: dffffc0000000000
FS: 000055558ba6b380(0000) GS:ffff8881257af000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000558c02111000 CR3: 0000000072048000 CR4: 00000000003526f0
Call Trace:
<TASK>
pcl818_detach+0x66/0xd0 drivers/comedi/drivers/pcl818.c:1115
comedi_device_detach+0x134/0x720 drivers/comedi/drivers.c:207
comedi_device_attach+0x568/0x670 drivers/comedi/drivers.c:1000
do_devconfig_ioctl drivers/comedi/comedi_fops.c:855 [inline]
comedi_unlocked_ioctl+0x686/0xf40 drivers/comedi/comedi_fops.c:2136
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:598 [inline]
__se_sys_ioctl+0xf9/0x170 fs/ioctl.c:584
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f05c37a33e9
Code: 48 83 c4 28 c3 e8 37 17 00 00 0f 1f 80 00 00 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffd45c1fac8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ffd45c1fc98 RCX: 00007f05c37a33e9
RDX: 0000200000000080 RSI: 0000000040946400 RDI: 0000000000000003
RBP: 00007f05c3816610 R08: 0000000000000000 R09: 00007ffd45c1fc98
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffd45c1fc88 R14: 0000000000000001 R15: 0000000000000001
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:pcl818_ai_cancel+0x69/0x3f0 drivers/comedi/drivers/pcl818.c:762
Code: 8b 1b 48 89 d8 48 c1 e8 03 42 80 3c 28 00 74 08 48 89 df e8 79 ca 34 f9 48 8b 03 48 89 04 24 49 83 c4 28 4c 89 e0 48 c1 e8 03 <42> 80 3c 28 00 74 08 4c 89 e7 e8 58 ca 34 f9 4d 8b 24 24 48 83 c3
RSP: 0018:ffffc90003ee79f0 EFLAGS: 00010206
RAX: 0000000000000005 RBX: ffff88802854df00 RCX: ffff888033bd3c00
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff88802f550000
RBP: 0000000000000001 R08: ffff88802f55012f R09: 1ffff11005eaa025
R10: dffffc0000000000 R11: ffffffff88efad60 R12: 0000000000000028
R13: dffffc0000000000 R14: ffff88802f550000 R15: dffffc0000000000
FS: 000055558ba6b380(0000) GS:ffff8881258af000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000005fdeb8 CR3: 0000000072048000 CR4: 00000000003526f0
----------------
Code disassembly (best guess):
0: 8b 1b mov (%rbx),%ebx
2: 48 89 d8 mov %rbx,%rax
5: 48 c1 e8 03 shr $0x3,%rax
9: 42 80 3c 28 00 cmpb $0x0,(%rax,%r13,1)
e: 74 08 je 0x18
10: 48 89 df mov %rbx,%rdi
13: e8 79 ca 34 f9 call 0xf934ca91
18: 48 8b 03 mov (%rbx),%rax
1b: 48 89 04 24 mov %rax,(%rsp)
1f: 49 83 c4 28 add $0x28,%r12
23: 4c 89 e0 mov %r12,%rax
26: 48 c1 e8 03 shr $0x3,%rax
* 2a: 42 80 3c 28 00 cmpb $0x0,(%rax,%r13,1) <-- trapping instruction
2f: 74 08 je 0x39
31: 4c 89 e7 mov %r12,%rdi
34: e8 58 ca 34 f9 call 0xf934ca91
39: 4d 8b 24 24 mov (%r12),%r12
3d: 48 rex.W
3e: 83 .byte 0x83
3f: c3 ret


---
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 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.

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

Hillf Danton

unread,
Jul 5, 2025, 8:39:05 AM7/5/25
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
> Date: Sat, 05 Jul 2025 03:41:26 -0700
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 26ffb3d6f02c Add linux-next specific files for 20250704
> git tree: linux-next
> console+strace: https://syzkaller.appspot.com/x/log.txt?x=1304cf70580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=8c567bd5a036e49d
> dashboard link: https://syzkaller.appspot.com/bug?extid=fce5d9d5bd067d6fbe9b
#syz test

--- x/drivers/comedi/drivers/pcl818.c
+++ y/drivers/comedi/drivers/pcl818.c
@@ -759,12 +759,15 @@ static int pcl818_ai_cancel(struct comed
{
struct pcl818_private *devpriv = dev->private;
struct comedi_isadma *dma = devpriv->dma;
- struct comedi_cmd *cmd = &s->async->cmd;

if (!devpriv->ai_cmd_running)
return 0;

if (dma) {
+ struct comedi_cmd *cmd;
+ if (!s || !s->async)
+ return 0;
+ cmd = &s->async->cmd;
if (cmd->stop_src == TRIG_NONE ||
(cmd->stop_src == TRIG_COUNT &&
s->async->scans_done < cmd->stop_arg)) {
--

syzbot

unread,
Jul 5, 2025, 10:06:05 AM7/5/25
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-by: syzbot+fce5d9...@syzkaller.appspotmail.com
Tested-by: syzbot+fce5d9...@syzkaller.appspotmail.com

Tested on:

commit: 26ffb3d6 Add linux-next specific files for 20250704
git tree: linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=1169cf70580000
compiler: Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132), Debian LLD 20.1.7
patch: https://syzkaller.appspot.com/x/patch.diff?x=164a1c8c580000

Note: testing is done by a robot and is best-effort only.

Nikita Zhandarovich

unread,
Oct 23, 2025, 9:46:25 AM10/23/25
to syzbot+fce5d9...@syzkaller.appspotmail.com, Nikita Zhandarovich, syzkall...@googlegroups.com, linux-...@vger.kernel.org
#syz test

---
drivers/comedi/drivers/pcl818.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/comedi/drivers/pcl818.c b/drivers/comedi/drivers/pcl818.c
index 4127adcfb229..06fe06396f23 100644
--- a/drivers/comedi/drivers/pcl818.c
+++ b/drivers/comedi/drivers/pcl818.c
@@ -1111,10 +1111,9 @@ static void pcl818_detach(struct comedi_device *dev)
{
struct pcl818_private *devpriv = dev->private;

- if (devpriv) {
- pcl818_ai_cancel(dev, dev->read_subdev);
+ if (devpriv)
pcl818_reset(dev);
- }
+
pcl818_free_dma(dev);
comedi_legacy_detach(dev);
}

syzbot

unread,
Oct 23, 2025, 10:05:08 AM10/23/25
to linux-...@vger.kernel.org, n.zhand...@fintech.ru, syzkall...@googlegroups.com
Hello,

syzbot tried to test the proposed patch but the build/boot failed:

fs/jfs/jfs_incore.h:86:13: error: type name does not allow function specifier to be specified
fs/jfs/jfs_incore.h:86:20: error: expected member name or ';' after declaration specifiers


Tested on:

commit: efb26a23 Add linux-next specific files for 20251023
git tree: linux-next
kernel config: https://syzkaller.appspot.com/x/.config?x=569c5a67fe7b33e7
dashboard link: https://syzkaller.appspot.com/bug?extid=fce5d9d5bd067d6fbe9b
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
patch: https://syzkaller.appspot.com/x/patch.diff?x=15e8c614580000

Reply all
Reply to author
Forward
0 new messages