CVE-2026-138967

ALSA: mpu401: shut down timer before freeing MPU

Published Nov 30, 2026 CVSS 3.1 · 4.1 Medium EPSS < 1% KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

ALSA: mpu401: shut down timer before freeing MPU

When an MPU401 interface has no usable IRQ, the driver polls raw-MIDI
input and output with a timer. During raw-MIDI teardown, the timer callback
can already be running when snd_mpu401_uart_remove_timer() clears the last
mode bit and calls timer_delete(). That API neither waits for a running
callback nor prevents it from rearming the timer, and free_irq() does not
synchronize timer callbacks. snd_mpu401_uart_free() can therefore release
mpu while the timer callback still uses it.

Initialize the timer once when the MPU object is created and only rearm it
while a timer mode is active. Shut it down synchronously after freeing the
IRQ so an in-flight callback completes before mpu and its resources are
released.

Analysis

AI-generated

Technical impact

The bug occurs in the ALSA mpu401 driver when there is no usable IRQ for an MPU401 interface. The driver polls raw‑MIDI input and output with a timer and, during teardown, the timer callback may still be running while snd_mpu401_uart_remove_timer() clears mode bits and invokes timer_delete(). The timer_delete() API does not wait for executing callbacks, and free_irq() does not provide synchronization. As a result, the driver can free the MPU structure while the timer callback continues to reference it, creating an explicit use‑after‑free condition that could lead to memory corruption.

Affected Systems

The vulnerability exists in the default Linux kernel as shipped in any version that includes the ALSA mpu401 driver before the patch. No specific kernel versions are listed, but the issue applies to all kernels affected until the commit that removes the timer before freeing the MPU is applied.

Risk and Exploitability

A use‑after‑free can be exploited to corrupt memory, potentially allowing privilege escalation or a denial‑of‑service crash. No EPSS score or KEV designation is currently available, and the CVSS score is not disclosed; however, the nature of the flaw and the lack of synchronization suggest a high risk if an attacker can trigger the timer while the device is being removed. The likely attack vector involves an attacker interacting with or timing the removal of a raw‑MIDI device.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update the kernel to a version that includes the ALSA mpu401 timer shutdown fix
  • If a kernel update is not available, disable or unload the mpu401 driver to keep the timer from running while the device is removed
  • Verify that the device is not in use before rebooting to avoid residual timer callbacks

Generated by OpenCVE AI on November 30, 2026 at 17:57 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-825
References
Metrics threat_severity

None

cvssV3_1

{'score': 4.1, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:H'}

threat_severity

Moderate

Type Values Removed Values Added
First Time appeared Linux linux
Vendors & Products Linux linux
Type Values Removed Values Added
Weaknesses CWE-367
CWE-416
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: ALSA: mpu401: shut down timer before freeing MPU When an MPU401 interface has no usable IRQ, the driver polls raw-MIDI input and output with a timer. During raw-MIDI teardown, the timer callback can already be running when snd_mpu401_uart_remove_timer() clears the last mode bit and calls timer_delete(). That API neither waits for a running callback nor prevents it from rearming the timer, and free_irq() does not synchronize timer callbacks. snd_mpu401_uart_free() can therefore release mpu while the timer callback still uses it. Initialize the timer once when the MPU object is created and only rearm it while a timer mode is active. Shut it down synchronously after freeing the IRQ so an in-flight callback completes before mpu and its resources are released.
Title ALSA: mpu401: shut down timer before freeing MPU
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-367

    Time-of-check Time-of-use (TOCTOU) Race Condition

  • CWE-416

    Use After Free

  • CWE-825

    Expired Pointer Dereference

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:26 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:17 PM
Modified
Nov 30, 2026, 2:17 PM
Severity
Moderate
Public date
Nov 30, 2026, 1:26 PM