From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B96B2F363F; Wed, 20 May 2026 18:10:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779300657; cv=none; b=cuqYB8YFWHmYe0x1wom2N7jUiZLGZp1hkpBPeR8j/WlmV4DAprl8HZZFcS6op0u8NGYi0Ee5C+rQJs+cUO7zXrjG4GyIja6tttCT3XymAGwuhmx5MetKNr/DHuVYgT6wC82VB7CHJXg+OIuUEHgK5jAklrmvvSO+rpCZ50mx/Gg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779300657; c=relaxed/simple; bh=yeKJdOhuqgBcmtrSpAc6NC71KAzWT9mnlOjVfKG8Hxo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KjJVKZvzyVfoxy2KkW70Bh8TreJ0p9NQA/QVCreaZCv/OQah0zr9R1RSvt7+iupEey/ZiuKFHxt+q5+mB7xFUpdPzchCgIEzjaaAKOP++6bxZyfSugkCpVDDOAp3tpTcQF0SxkWes12ClPIMRaCvPxoNOjCKrYYKUJDYQMDGCGg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=kEaivya7; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="kEaivya7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E956F1F000E9; Wed, 20 May 2026 18:10:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779300656; bh=Wn7AOKwTZBgstDo6BX6yRNj6y35BKYtiAquimRO0jfc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=kEaivya7ZwoaVVwwIiqtIbLScEBu57A7+jWgb7bTWDAKJRonwZoIFkP8/24WuKYul XO84Tpw6ycojD/HgmnFji3H7+fLXjheT2UcQKrsZSfEzce4EaiaWdpm/58Fhy2xCX5 0pE1bFf+mc9l3GxHeL7wSTck/DuGHqwTuHPR6ACs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Srinivas Kandagatla , Mark Brown , Sasha Levin Subject: [PATCH 6.12 217/666] ASoC: qcom: qdsp6: topology: check widget type before accessing data Date: Wed, 20 May 2026 18:17:08 +0200 Message-ID: <20260520162115.912949625@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260520162111.222830634@linuxfoundation.org> References: <20260520162111.222830634@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Srinivas Kandagatla [ Upstream commit d5bfdd28e0cdd45043ae6e0ac168a451d59283dc ] Check widget type before accessing the private data, as this could a virtual widget which is no associated with a dsp graph, container and module. Accessing witout check could lead to incorrect memory access. Fixes: 36ad9bf1d93d ("ASoC: qdsp6: audioreach: add topology support") Signed-off-by: Srinivas Kandagatla Link: https://patch.msgid.link/20260402081118.348071-4-srinivas.kandagatla@oss.qualcomm.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/qcom/qdsp6/topology.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sound/soc/qcom/qdsp6/topology.c b/sound/soc/qcom/qdsp6/topology.c index 01bb1bdee5cec..6f5534b8092b5 100644 --- a/sound/soc/qcom/qdsp6/topology.c +++ b/sound/soc/qcom/qdsp6/topology.c @@ -930,9 +930,6 @@ static int audioreach_widget_unload(struct snd_soc_component *scomp, struct audioreach_container *cont; struct audioreach_module *mod; - mod = dobj->private; - cont = mod->container; - if (w->id == snd_soc_dapm_mixer) { /* virtual widget */ struct snd_ar_control *scontrol = dobj->private; @@ -941,6 +938,11 @@ static int audioreach_widget_unload(struct snd_soc_component *scomp, kfree(scontrol); return 0; } + mod = dobj->private; + if (!mod) + return 0; + + cont = mod->container; mutex_lock(&apm->lock); idr_remove(&apm->modules_idr, mod->instance_id); -- 2.53.0