* [PATCH] ALSA: hda: cs35l41: Fix NULL pointer dereference in cs35l41_get_acpi_mute_state()
@ 2025-10-07 7:38 Denis Arefev
2025-10-11 6:30 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Denis Arefev @ 2025-10-07 7:38 UTC (permalink / raw)
To: David Rhodes
Cc: Richard Fitzgerald, Jaroslav Kysela, Takashi Iwai, Stefan Binding,
linux-sound, patches, linux-kernel, lvc-project, stable
Return value of a function acpi_evaluate_dsm() is dereferenced without
checking for NULL, but it is usually checked for this function.
acpi_evaluate_dsm() may return NULL, when acpi_evaluate_object() returns
acpi_status other than ACPI_SUCCESS, so add a check to prevent the crach.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 447106e92a0c ("ALSA: hda: cs35l41: Support mute notifications for CS35L41 HDA")
Cc: stable@vger.kernel.org
Signed-off-by: Denis Arefev <arefev@swemel.ru>
---
sound/hda/codecs/side-codecs/cs35l41_hda.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/hda/codecs/side-codecs/cs35l41_hda.c b/sound/hda/codecs/side-codecs/cs35l41_hda.c
index 37f2cdc8ce82..890ddb8cc66c 100644
--- a/sound/hda/codecs/side-codecs/cs35l41_hda.c
+++ b/sound/hda/codecs/side-codecs/cs35l41_hda.c
@@ -1426,6 +1426,8 @@ static int cs35l41_get_acpi_mute_state(struct cs35l41_hda *cs35l41, acpi_handle
if (cs35l41_dsm_supported(handle, CS35L41_DSM_GET_MUTE)) {
ret = acpi_evaluate_dsm(handle, &guid, 0, CS35L41_DSM_GET_MUTE, NULL);
+ if (!ret)
+ return -EINVAL;
mute = *ret->buffer.pointer;
dev_dbg(cs35l41->dev, "CS35L41_DSM_GET_MUTE: %d\n", mute);
}
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] ALSA: hda: cs35l41: Fix NULL pointer dereference in cs35l41_get_acpi_mute_state()
2025-10-07 7:38 [PATCH] ALSA: hda: cs35l41: Fix NULL pointer dereference in cs35l41_get_acpi_mute_state() Denis Arefev
@ 2025-10-11 6:30 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2025-10-11 6:30 UTC (permalink / raw)
To: Denis Arefev
Cc: David Rhodes, Richard Fitzgerald, Jaroslav Kysela, Takashi Iwai,
Stefan Binding, linux-sound, patches, linux-kernel, lvc-project,
stable
On Tue, 07 Oct 2025 09:38:31 +0200,
Denis Arefev wrote:
>
> Return value of a function acpi_evaluate_dsm() is dereferenced without
> checking for NULL, but it is usually checked for this function.
>
> acpi_evaluate_dsm() may return NULL, when acpi_evaluate_object() returns
> acpi_status other than ACPI_SUCCESS, so add a check to prevent the crach.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Fixes: 447106e92a0c ("ALSA: hda: cs35l41: Support mute notifications for CS35L41 HDA")
> Cc: stable@vger.kernel.org
> Signed-off-by: Denis Arefev <arefev@swemel.ru>
Applied now. Thanks.
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-10-11 6:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-07 7:38 [PATCH] ALSA: hda: cs35l41: Fix NULL pointer dereference in cs35l41_get_acpi_mute_state() Denis Arefev
2025-10-11 6:30 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox