From: Takashi Iwai <tiwai@suse.de>
To: Denis Arefev <arefev@swemel.ru>
Cc: David Rhodes <david.rhodes@cirrus.com>,
Richard Fitzgerald <rf@opensource.cirrus.com>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
linux-sound@vger.kernel.org, patches@opensource.cirrus.com,
linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org,
stable@vger.kernel.org
Subject: Re: [PATCH v2] ALSA: hda: Fix missing pointer check in hda_component_manager_init function
Date: Sat, 11 Oct 2025 08:30:43 +0200 [thread overview]
Message-ID: <87ldli9ch8.wl-tiwai@suse.de> (raw)
In-Reply-To: <20251009105050.20806-1-arefev@swemel.ru>
On Thu, 09 Oct 2025 12:50:47 +0200,
Denis Arefev wrote:
>
> The __component_match_add function may assign the 'matchptr' pointer
> the value ERR_PTR(-ENOMEM), which will subsequently be dereferenced.
>
> The call stack leading to the error looks like this:
>
> hda_component_manager_init
> |-> component_match_add
> |-> component_match_add_release
> |-> __component_match_add ( ... ,**matchptr, ... )
> |-> *matchptr = ERR_PTR(-ENOMEM); // assign
> |-> component_master_add_with_match( ... match)
> |-> component_match_realloc(match, match->num); // dereference
>
> Add IS_ERR() check to prevent the crash.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Fixes: ae7abe36e352 ("ALSA: hda/realtek: Add CS35L41 support for Thinkpad laptops")
> Cc: stable@vger.kernel.org
> Signed-off-by: Denis Arefev <arefev@swemel.ru>
> ---
> V1 -> V2:
> Changed tag Fixes
> Add print to log an error it as Stefan Binding <sbinding@opensource.cirrus.com> suggested
Applied now. Thanks.
Takashi
prev parent reply other threads:[~2025-10-11 6:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-09 10:50 [PATCH v2] ALSA: hda: Fix missing pointer check in hda_component_manager_init function Denis Arefev
2025-10-11 6:30 ` Takashi Iwai [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ldli9ch8.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=arefev@swemel.ru \
--cc=david.rhodes@cirrus.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=patches@opensource.cirrus.com \
--cc=perex@perex.cz \
--cc=rf@opensource.cirrus.com \
--cc=stable@vger.kernel.org \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox