CVE-2026-31751: comedi: dt2815: add hardware detection to prevent crash
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
comedi: dt2815: add hardware detection to prevent crash
The dt2815 driver crashes when attached to I/O ports without actual hardware present. This occurs because syzkaller or users can attach the driver to arbitrary I/O addresses via COMEDI_DEVCONFIG ioctl.
When no hardware exists at the specified port, inb() operations return 0xff (floating bus), but outb() operations can trigger page faults due to undefined behavior, especially under race conditions:
BUG: unable to handle page fault for address: 000000007fffff90 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page RIP: 0010:dt2815_attach+0x6e0/0x1110
Add hardware detection by reading the status register before attempting any write operations. If the read returns 0xff, assume no hardware is present and fail the attach with -ENODEV. This prevents crashes from outb() operations on non-existent hardware.
The Linux kernel CVE team has assigned CVE-2026-31751 to this issue.
Affected and fixed versions
===========================
Fixed in 5.10.253 with commit 8d63161837f1bf8810dbcd2a583c2bbf5ca6d733 Fixed in 5.15.203 with commit d2a786efdb9971f2a647724625da5bbecc994dc9 Fixed in 6.1.168 with commit 0dcf33994b8dcf3db36530fb7e2cf9f89e5cbac3 Fixed in 6.6.134 with commit d5d9df8b08d68d083ac57abc2c887dfb1f31af63 Fixed in 6.12.81 with commit 65c528fbeddd88478c210052f6c7b21be4973156 Fixed in 6.18.22 with commit 34c8b3a91bdfbe4573650b4cd750ef639101fdc5 Fixed in 6.19.12 with commit 34b13250c618d7441508c6ef369144aa8a9b9bfa Fixed in 7.0 with commit 93853512f565e625df2397f0d8050d6aafd7c3ad
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-31751
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/comedi/drivers/dt2815.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/8d63161837f1bf8810dbcd2a583c2bbf5ca6d733 https://git.kernel.org/stable/c/d2a786efdb9971f2a647724625da5bbecc994dc9 https://git.kernel.org/stable/c/0dcf33994b8dcf3db36530fb7e2cf9f89e5cbac3 https://git.kernel.org/stable/c/d5d9df8b08d68d083ac57abc2c887dfb1f31af63 https://git.kernel.org/stable/c/65c528fbeddd88478c210052f6c7b21be4973156 https://git.kernel.org/stable/c/34c8b3a91bdfbe4573650b4cd750ef639101fdc5 https://git.kernel.org/stable/c/34b13250c618d7441508c6ef369144aa8a9b9bfa https://git.kernel.org/stable/c/93853512f565e625df2397f0d8050d6aafd7c3ad