CVE-2026-139453: ALSA: hda: Stop unsol events and jack polling before codec unbind
In the Linux kernel, the following vulnerability has been resolved:
ALSA: hda: Stop unsol events and jack polling before codec unbind
At unbinding a codec driver, hdacodecdriverremove() calls the codec's remove callback that releases the driver resources, followed by sndhdacodeccleanupforunbind(). Meanwhile, the unsolicited events are processed asynchronously in bus->unsolwork, and sndhdacbusprocessunsolevents() checks only codec->registered flag before calling the driver's unsolevent callback without the lock. Since codec->registered is cleared only in sndhdacodeccleanupforunbind(), and there is no flush of the unsol work at unbinding, the unsol event handler may run concurrently during the running remove callback, which may lead to a UAF. The same problem applies to the jack polling work, which is canceled only after the remove callback.
For addressing those races, introduce a new flag unsoldisabled to hdacdevice, to be checked it in the unsol event worker, while a new helper sndhdacdevicedisableunsol() sets this flag and flushes the pending unsol work. The helper is called at hdacodecdriverremove() together with the cancel of jackpollwork to assure that no asynchronous jack handling can run. The flag is cleared again at probing the codec driver, while the events are still blocked by the registered flag until the codec gets registered.
Affected Software
Event History
Frequently Asked Questions
Under what condition can the use-after-free occur?
The race can occur while an HDA codec driver is being unbound. An unsolicited-event worker may invoke the driver’s unsolicited-event callback while the driver’s remove callback is releasing its resources; jack polling can similarly remain active during removal.
What does the resolved change do to prevent the race?
It disables unsolicited events and flushes pending unsolicited-event work before the codec remove callback runs. It also cancels jack-polling work before removal, preventing those asynchronous paths from using resources that the callback may free.