CVE-2024-38605: ALSA: core: Fix NULL module pointer assignment at card init
In the Linux kernel, the following vulnerability has been resolved:
ALSA: core: Fix NULL module pointer assignment at card init
The commit 81033c6b584b ("ALSA: core: Warn on empty module") introduced a WARNON() for a NULL module pointer passed at sndcard object creation, and it also wraps the code around it with '#ifdef MODULE'. This works in most cases, but the devils are always in details. "MODULE" is defined when the target code (i.e. the sound core) is built as a module; but this doesn't mean that the caller is also built-in or not. Namely, when only the sound core is built-in (CONFIGSND=y) while the driver is a module (CONFIGSNDUSBAUDIO=m), the passed module pointer is ignored even if it's non-NULL, and card->module remains as NULL. This would result in the missing module reference up/down at the device open/close, leading to a race with the code execution after the module removal.
For addressing the bug, move the assignment of card->module again out of ifdef. The WARNON() is still wrapped with ifdef because the module can be really NULL when all sound drivers are built-in.
Note that we keep 'ifdef MODULE' for WARNON(), otherwise it would lead to a false-positive NULL module check. Admittedly it won't catch perfectly, i.e. no check is performed when CONFIGSND=y. But, it's no real problem as it's only for debugging, and the condition is pretty rare.
Other sources
In the Linux kernel, the following vulnerability has been resolved:
ALSA: core: Fix NULL module pointer assignment at card init
The Linux kernel CVE team has assigned CVE-2024-38605 to this issue.
Upstream advisory: https://lore.kernel.org/linux-cve-announce/2024061925-CVE-2024-38605-3dc4@gregkh/T
— Red Hat
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 5.10.219 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 5.15.161 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 6.1.93 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 6.6.33 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 6.8.12 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 6.9.3 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 6.10 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 5.10.223-1Fixed in 5.10.234-1Fixed in 6.1.129-1Fixed in 6.1.135-1Fixed in 6.12.25-1Fixed in 6.12.27-1 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Patch 81033c6b584b - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Patch CVE-2024-38605
Event History
Frequently Asked Questions
What is the severity of CVE-2024-38605?
CVE-2024-38605 has a medium severity rating due to its impact on the ALSA subsystem in the Linux kernel.
How do I fix CVE-2024-38605?
To fix CVE-2024-38605, you should upgrade your kernel to the recommended versions, including 5.10.219 or later, 5.15.161 or later, and respective versions for 6.x series as specified.
What systems are affected by CVE-2024-38605?
CVE-2024-38605 affects various versions of the Linux kernel in both Red Hat and Debian distributions.
What are the recommended kernel versions for CVE-2024-38605?
Recommended kernel versions to resolve CVE-2024-38605 include 5.10.219, 5.15.161, 6.1.93, 6.6.33, 6.8.12, 6.9.3, and 6.10.
Does CVE-2024-38605 affect user applications?
CVE-2024-38605 primarily impacts the ALSA subsystem, which may affect audio-related applications but does not directly compromise user applications.