CVE-2026-31749 comedi: ni_atmio16d: Fix invalid clean-up after failed attach
A null pointer dereference in the ni_atmio16d driver cleanup path can cause a kernel crash if attach fails, leading to denial of service.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2026-31749?
CVE-2026-31749 is a medium-severity vulnerability in Linux kernel, published on 1 May 2026. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
In the Linux kernel, the following vulnerability has been resolved:
comedi: ni_atmio16d: Fix invalid clean-up after failed attach
If the driver's COMEDI "attach" handler function (`atmio16d_attach()`) returns an error, the COMEDI core will call the driver's "detach" handler function (`atmio16d_detach()`) to clean up. This calls `reset_atmio16d()` unconditionally, but depending on where the error occurred in the attach handler, the device may not have been sufficiently initialized to call `reset_atmio16d()`. 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 `atmio16d_detach()` by checking that `dev->private` is valid (non-null) before calling `reset_atmio16d()`. This implies that `dev->iobase` was set correctly since that is set up before `dev->private`.
Weakness: CWE-476
Which versions are affected by CVE-2026-31749?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2026-31749?
Apply the vendor's patch.
Is CVE-2026-31749 being exploited?
There is no known exploitation of CVE-2026-31749 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as BELL-CVE-2026-31749, DEBIAN-CVE-2026-31749, GHSA-jgc9-fr2g-9r52, ROOT-OS-DEBIAN-11-CVE-2026-31749, ROOT-OS-UBUNTU-2204-CVE-2026-31749, ROOT-OS-UBUNTU-2404-CVE-2026-31749 and 1 more.