CVE-2026-31749: comedi: ni_atmio16d: Fix invalid clean-up after failed attach

Published May 1, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

comedi: niatmio16d: Fix invalid clean-up after failed attach

If the driver's COMEDI "attach" handler function (atmio16dattach()) returns an error, the COMEDI core will call the driver's "detach" handler function (atmio16ddetach()) to clean up. This calls resetatmio16d() unconditionally, but depending on where the error occurred in the attach handler, the device may not have been sufficiently initialized to call resetatmio16d(). It uses dev->iobase as the I/O port base address and dev->private as the pointer to the COMEDI device's private data structure. dev->iobase may still be set to its initial value of 0, which would result in undesired writes to low I/O port addresses. dev->private may still be NULL, which would result in null pointer dereferences.

Fix atmio16ddetach() by checking that dev->private is valid (non-null) before calling resetatmio16d(). This implies that dev->iobase was set correctly since that is set up before dev->private.

Affected Software

15 affected componentsFixes available
Linux Linux kernel (comedi: ni_atmio16d)
Linux Linux kernel>=2.6.30<5.10.253
Linux Linux kernel>=5.11<5.15.203
Linux Linux kernel>=5.16<6.1.168
Linux Linux kernel>=6.2<6.6.134
Linux Linux kernel>=6.7<6.12.81
Linux Linux kernel>=6.13<6.18.22
Linux Linux kernel>=6.19<6.19.12
Linux Linux kernel=7.0-rc1
Linux Linux kernel=7.0-rc2
Linux Linux kernel=7.0-rc3
Linux Linux kernel=7.0-rc4
Linux Linux kernel=7.0-rc5
Linux Linux kernel=7.0-rc6
debian/linux
6.1.176-16.1.190-16.12.107-16.12.115-27.2.12-17.2.15-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.1.176-1Fixed in 6.1.190-1Fixed in 6.12.107-1Fixed in 6.12.113-1Fixed in 7.2.12-1Fixed in 7.2.13-1
  2. Compensating control

    In the Linux kernel comedi ni_atmio16d driver, update atmio16d_detach() to verify that dev->private is non-null before calling reset_atmio16d().

Event History

May 1, 2026
CVE Published
via MITRE·02:14 PM
Data Sourced
via MITRE·02:14 PM
Description
Data Sourced
via NVD·03:16 PM
RemedyDescriptionSeverityWeaknessAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

Who is exposed to this issue?

Systems using the Linux kernel with the COMEDI ni_atmio16d driver are exposed when that driver's attach operation fails. The issue occurs in the error-cleanup path rather than during normal successful attachment.

2

What is required to trigger the problem?

An attacker or local user needs to cause atmio16d_attach() to return an error after the COMEDI attach handler has begun but before all device fields are initialized. The affected cleanup then calls reset_atmio16d() with a potentially null dev->private pointer or an iobase value of 0.

3

What is the impact of a failed attach on an affected system?

The cleanup path can dereference a null pointer, causing a denial of service. It can also write to unintended low I/O port addresses when dev->iobase remains at its initial value of 0.

4

What change resolves the issue?

The fix makes atmio16d_detach() verify that dev->private is non-null before calling reset_atmio16d(). Because dev->iobase is set before dev->private, this check also ensures the I/O base was initialized before reset is attempted.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203