CVE-2026-98749: tty: serial: max3100: shut down timer before freeing port
In the Linux kernel, the following vulnerability has been resolved:
tty: serial: max3100: shut down timer before freeing port
max3100shutdown() stops the polling timer but returns early during system suspend. If the SPI device is unbound before resume, the serial core does not call max3100shutdown() again, so max3100remove() frees the port while the timer remains armed. max3100timeout() may then access the freed port and re-arm the timer.
Add final timer teardown to max3100remove() and use timershutdownsync() to prevent a racing callback from re-arming it. Also free the IRQ and destroy the workqueue there before freeing the port. Keep timerdeletesync() in max3100shutdown() so that a subsequent open() can re-arm the timer.
The workqueue is created before requestirq() and destroyed on both requestirq() failure and normal shutdown. Its presence at remove thus identifies the IRQ left registered when suspend bypasses shutdown.
Free the IRQ before destroying the workqueue, in both max3100shutdown() and max3100remove(), and cancel the pending work in between. freeirq() waits for a running interrupt handler to finish and no new handler can start afterwards, so a racing handler cannot queue work on a workqueue that is being destroyed; the forceendwork check in max3100dowork() only narrows that window, as a handler delayed between the check and queuework() could still run after the teardown has cleared the workqueue pointer. Cancelling the work also keeps destroyworkqueue() from waiting on a queued work item in case remove() ever runs while the freezable workqueue is still frozen, e.g. device removal during the resume window, before workqueues are thawed.
This issue was found by an in-house static analysis tool.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.113-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.2.10-1 - Upgrade
Upgrade
debian/linux-6.12to a version that resolves this vulnerability.Fixed in 6.12.113-1~deb12u1 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.10.273 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.15.224 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.1.191 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.6.160 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.113 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.56 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.2.10 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.115-2Fixed in 7.2.12-1Fixed in 7.2.15-1 - Upgrade
Upgrade
azurelinux/kernelto a version that resolves this vulnerability.Fixed in 6.6.161.1-1 - Operational
Update the max3100 driver teardown so max3100_remove() calls timer_shutdown_sync() to prevent a racing callback from re-arming the timer, frees the IRQ, cancels pending work, and destroys the workqueue before freeing the port. In both max3100_shutdown() and max3100_remove(), free the IRQ before destroying the workqueue and cancel pending work between those operations; retain timer_delete_sync() in max3100_shutdown() so a subsequent open() can re-arm the timer.
Event History
Frequently Asked Questions
Which systems are exposed to this issue?
Systems using the Linux kernel MAX3100 serial driver are exposed when a MAX3100 SPI device can be unbound while the system is suspended, before it resumes. The issue involves the driver's polling timer, IRQ handling, and workqueue cleanup during device removal.
What condition triggers the use-after-free?
The timer is stopped during shutdown, but shutdown returns early during system suspend. If the SPI device is then unbound before resume, device removal can free the serial port while the polling timer is still armed; a later timer callback can access and re-arm the freed port.
What mitigation is available if the kernel fix cannot be applied immediately?
Avoid unbinding or removing the MAX3100 SPI device while the system is suspended. Ensure the system resumes before performing device removal operations involving this driver.
How can I determine whether my environment is affected?
Check whether the running kernel uses the MAX3100 serial driver and whether operational procedures allow its SPI device to be unbound or removed during system suspend. The vulnerable sequence specifically requires suspension followed by device unbinding before resume.