Bug 2347718 (CVE-2021-47650) - CVE-2021-47650 kernel: ASoC: soc-compress: prevent the potentially use of null pointer
Summary: CVE-2021-47650 kernel: ASoC: soc-compress: prevent the potentially use of nul...
Keywords:
Status: NEW
Alias: CVE-2021-47650
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-02-26 03:04 UTC by OSIDB Bzimport
Modified: 2025-02-28 12:45 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2025-02-26 03:04:18 UTC
In the Linux kernel, the following vulnerability has been resolved:

ASoC: soc-compress: prevent the potentially use of null pointer

There is one call trace that snd_soc_register_card()
->snd_soc_bind_card()->soc_init_pcm_runtime()
->snd_soc_dai_compress_new()->snd_soc_new_compress().
In the trace the 'codec_dai' transfers from card->dai_link,
and we can see from the snd_soc_add_pcm_runtime() in
snd_soc_bind_card() that, if value of card->dai_link->num_codecs
is 0, then 'codec_dai' could be null pointer caused
by index out of bound in 'asoc_rtd_to_codec(rtd, 0)'.
And snd_soc_register_card() is called by various platforms.
Therefore, it is better to add the check in the case of misusing.
And because 'cpu_dai' has already checked in soc_init_pcm_runtime(),
there is no need to check again.
Adding the check as follow, then if 'codec_dai' is null,
snd_soc_new_compress() will not pass through the check
'if (playback + capture != 1)', avoiding the leftover use of
'codec_dai'.

Comment 3 Avinash Hanwate 2025-02-28 03:48:55 UTC
Upstream advisory:
https://lore.kernel.org/linux-cve-announce/2025022649-CVE-2021-47650-d468@gregkh/T

Comment 7 Avinash Hanwate 2025-02-28 04:32:49 UTC
Upstream advisory:
https://lore.kernel.org/linux-cve-announce/2025022649-CVE-2021-47650-d468@gregkh/T


Note You need to log in before you can comment on or make changes to this bug.