CVE-2024-56685: ASoC: mediatek: Check num_codecs is not zero to avoid panic during probe

Published Dec 28, 2024
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

ASoC: mediatek: Check numcodecs is not zero to avoid panic during probe

Following commit 13f58267cda3 ("ASoC: soc.h: don't create dummy Component via COMPDUMMY()"), COMPDUMMY() became an array with zero length, and only gets populated with the dummy struct after the card is registered. Since the sound card driver's probe happens before the card registration, accessing any of the members of a dummy component during probe will result in undefined behavior.

This can be observed in the mt8188 and mt8195 machine sound drivers. By omitting a dai link subnode in the sound card's node in the Devicetree, the default uninitialized dummy codec is used, and when its dainame pointer gets passed to strcmp() it results in a null pointer dereference and a kernel panic.

In addition to that, setcardcodecinfo() in the generic helpers file, mtk-soundcard-driver.c, will populate a dai link with a dummy codec when a dai link node is present in DT but with no codec property.

The result is that at probe time, a dummy codec can either be uninitialized with numcodecs = 0, or be an initialized dummy codec, with numcodecs = 1 and dainame = "snd-soc-dummy-dai". In order to accommodate for both situations, check that numcodecs is not zero before accessing the codecs' fields but still check for the codec's dai name against "snd-soc-dummy-dai" as needed.

While at it, also drop the check that dainame is not null in the mt8192 driver, introduced in commit 4d4e1b6319e5 ("ASoC: mediatek: mt8192: Check existence of dainame before dereferencing"), as it is actually redundant given the preceding numcodecs != 0 check.

Other sources

This CVE was automatically created from a reference found in an email or other text. If you are reading this, then this CVE entry is probably erroneous, since this text should be replaced by the official CVE description automatically.

Launchpad

Affected Software

4 affected componentsFixes available
Linux Kernel
debian/linux
5.10.223-15.10.234-16.1.129-16.1.135-16.12.22-16.12.25-1
Linux Linux kernel>=6.8<6.11.11
Linux Linux kernel>=6.12<6.12.2

Event History

Dec 28, 2024
CVE Published
via MITRE·09:46 AM
Data Sourced
via MITRE·09:46 AM
Description
Data Sourced
via NVD·10:15 AM
Description
Data Sourced
via NVD·10:15 AM
RemedySeverityWeaknessAffected Software
Apr 17, 2025
Data Sourced
via Launchpad·01:13 AM
Description
May 3, 2025
Data Sourced
via Ubuntu·01:14 AM
RemedyDescriptionSeverityAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2024-56685?

CVE-2024-56685 has a moderate severity rating due to its potential to cause a panic during probe execution in the Linux kernel.

2

How do I fix CVE-2024-56685?

To fix CVE-2024-56685, ensure you have updated to a patched version of the Linux kernel that includes the commit address in the vulnerability details.

3

What software is affected by CVE-2024-56685?

CVE-2024-56685 affects the Linux kernel, specifically variations that utilize ASoC components.

4

What are the implications of CVE-2024-56685?

The implications of CVE-2024-56685 include possible system crashes if num_codecs is incorrectly configured during initialization.

5

Is CVE-2024-56685 easily exploitable?

CVE-2024-56685 is not easily exploitable but could lead to denial of service if the conditions are met during device probing.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203