ALSA: bcd2000: Fix race between rawmidi and disconnect
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 459d3a64766f5ca2f1886daeaf24582831a5f5ab · < 221253723dc58bb901c3f27a7659823e63fc598c| No fix yet |
| Linux Linux |
| No fix yet |
In the Linux kernel, the following vulnerability has been resolved:
ALSA: bcd2000: Fix race between rawmidi and disconnect
Although we tried to fix the potential UAF issues at USB disconnect on bcd2000 driver, there is still an overlooked case -- namely, when a rawmidi trigger callback has been already running at USB disconnect handling, the in-flight function (e.g. bcd2000_midi_send()) could still access the URB, because the previous URB NULL-check & clearance was considered only for the URB complete callbacks, but not about the parallel rawmidi operations.
For addressing the race, this patch introduced a new spinlock that covers each rawmidi operation as well as the rawmidi handling in the complete callback. The URB is cleared with the lock, so it guarantees that the pending rawmidi task already finished or a NULL check is effective.
From the CVE record · Linux
The Linux kernel’s ALSA bcd2000 driver has a race between rawmidi operations and USB disconnect handling. If a rawmidi trigger callback is running during disconnect, it can access a URB after it has been cleared, creating a potential use-after-free. The input does not specify attacker access requirements or an exploitation path.
Operators running Linux kernels with the ALSA bcd2000 driver should check their kernel versions; affected versions are not specified.