Received: from mail-dy1-f170.google.com (mail-dy1-f170.google.com [74.125.82.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4EE0841D216 for ; Wed, 14 Oct 2026 19:37:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792006677; cv=none; b=kNDUbYo3C+jx8T8zxu/l6alop1ElcnPrciih7yuiWo4hp0bE+0crGMinwhB+2TND8VpeUr3xqXPRp6Z5B7RQO+thcUJOxd+K81hScZ5zLEhUQvdeXWpF5xyD2iVKCBYI6rc22L70UNwU9Ojj1ItkWpDKOWVXICIxfMT9LDxb21M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792006677; c=relaxed/simple; bh=ObMYjck/H6XcNs75oCe1fV8PVDjoFJCKP174W+DH64A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=jft76TTmQz4Ut5AuZMGxBUpOIoreijegwY52TCmEu0Q8pKMoVDuQ5NpQk12G8gNpSYNvkvzJd+cZXrENgVYD9hh0JN/6HbDoY9aFJ59JCdMbdA+wPxb/rz3RpeMrPexigDSS5ziGFHddCoM+y0hknvKhOZTn8gL+eKFXf67KfaE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=trailofbits.com; spf=pass smtp.mailfrom=trailofbits.com; dkim=pass (2048-bit key) header.d=trailofbits.com header.i=@trailofbits.com header.b=EFTK90m1; arc=none smtp.client-ip=74.125.82.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=trailofbits.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=trailofbits.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=trailofbits.com header.i=@trailofbits.com header.b="EFTK90m1" Received: by mail-dy1-f170.google.com with SMTP id 5a478bee46e88-35f1f76ea84so14387eec.1 for ; Wed, 14 Oct 2026 12:37:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trailofbits.com; s=google; t=1792006675; x=1792611475; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to :content-type; bh=wSKDNnQRNy2/8dHJazcEc+4Vg6sKgqf+FQWePTpfAZ4=; b=EFTK90m1xWk6P7yvztdOccA+zN4Q5O923N0RQv7838NxeBOSTzKl86I8KABtBQ+TkF z7u/x4fFaTEXM4Yhg7gD+pu2zXpKyw1BLkXOPOVtmOgWo1NuXcDj4ETGP4lk0fRsC3Gr ZPRMKdxZesOA32TcFaft8r/JtpPCP7FGFefFoq0EQ7G/GbjGGzbcrr4/WI/G+c284NBe 19YwT9Y94lxt6YsY73FupdNdl63zfc9E9BHE4s01D8W1MN/omM0aP8XhgO2HB5YGn0aU 3JWCNhD4JodGr6Pf+aezZKaJFrQhYHlq+h9Z/KGNrLsRo1lKY4SBKmSPbujyLf/y0e1b Wu9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792006675; x=1792611475; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to:content-type; bh=wSKDNnQRNy2/8dHJazcEc+4Vg6sKgqf+FQWePTpfAZ4=; b=NbLKCWcg3/Vd+8gI9Hvn0JGU4Hdsph4P3i6GxICmQdWeTCdpTx0wUjMuNh6S0RqPz3 JTRTYY7s03h55usyZFg73DTBaSMdjtqR7VtRyV1Uhs71LV8gh88CHrc0CjJhZsjLr0sr l543LjgHPlf9FSbuwL27MjGpS1UK1pnMt8Fo0DyxhKrMIqxCpdepoh1yqgKztjqfgDZQ 5gY/fDI2oJfz1OQ1KK3U9gOZSAWJpe7TRIsAeq0F44hs2f5yYRQfIRnVahUKxVXpAIN/ tj3HCQvR6N49ZI92SjMyfLOOfH/LTAvpOLDnWsl9VgZUgyIAVQFWXhZE/DZS3RCzlOZD qWPQ== X-Forwarded-Encrypted: i=1; AKwUvByELSdGr3e9dMsHciJ/4/8edJYwPozYESTE3fm6442Mdw/lJs0QWoOiZJGuHxEvZXsKNxKZzvKjjSmmlA==@vger.kernel.org X-Gm-Message-State: AFq9FYKitTbjT36cu+BTHGuFv/kW1H7s/suWHERpws39LSR6CUmu2iH3 Dt1wNfXz239o5XDkseoJW9EzoZ7FJEXtKYOrEDYYLNsCR+J3Hc59EbNrBBUwQHvXopypnnKcmae AxsPcIwZSfQ== X-Gm-Gg: AYBFou3DpKC+wAXMBcu4giajYIP+GynwFFIKK0+Fqlz6Az7rtkhJXYDnW19Aze2uRj5 xQ5NbmrKo8MyU516t68Wdu/ejiwBUFhvoznARIw+3LQdNRDcHuY13HPm5gsnsYksq3rLAiv4MOT cHUzVeaxNWkbo3mC68gz0kNviJIwFk3/Ze9hSXGTwZ/saposOl/8t8jZLZ3vgkGKIuiBXqXNPgi rrMTN3WO5b4XBDmT1DsejI4GtkX2HJBB0mc2Bd85scvE+VTGWc4vwaqovsMgTwYZ4pMN3HrXM9f J9K7ePN78BrGP9o9ZXTJIOTTO0bAPtxMps1CX+NnQmMDr987A0cjzbgr5c6Ui3j555uGDDCokKR FhAmWsU0e5VM6/VbCyPG6YrwGK2sPrWsSAAgIqhwEU9LqXwJmTda/B8YAhO6IBVguKfYhdyjBbu /GmOteCANiNYNMB0n5gbOziTys7YihPn/+EFCaBTf1nbWi2bX4Ct0mLeHYo43vaYrD7Sx3qSM38 WMbQEU7QUqe4g3XaxHjxCXiKsOyEVNRDXANNGaQh8vhPFVr7z0clHKqIs+vwSu1U2CypXU= X-Received: by 2002:a05:7300:fc0a:b0:351:7ec1:a92c with SMTP id 5a478bee46e88-3537e11c9c5mr23889883eec.28.1792006675265; Wed, 14 Oct 2026 12:37:55 -0700 (PDT) Received: from localhost.localdomain ([2603:8001:5f01:8bab:39d1:d8de:aae7:23dd]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3537ca0e64csm60589703eec.10.2026.10.14.12.37.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 14 Oct 2026 12:37:54 -0700 (PDT) From: Artem Dinaburg To: stable@vger.kernel.org Cc: broonie@kernel.org, daniel.baluta@nxp.com, kai.vehmanen@linux.intel.com, lgirdwood@gmail.com, liam.r.girdwood@intel.com, linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org, perex@perex.cz, peter.ujfalusi@linux.intel.com, pierre-louis.bossart@linux.dev, ranjani.sridharan@linux.intel.com, sound-open-firmware@alsa-project.org, tiwai@suse.com, vijendar.mukunda@amd.com, yung-chuan.liao@linux.intel.com Subject: [PATCH 6.6.y] ASoC: SOF: Intel: hda-dai: Ensure DAI widget is valid during params Date: Wed, 14 Oct 2026 15:37:51 -0400 Message-ID: <20261014193751.25230-1-artem@trailofbits.com> X-Mailer: git-send-email 2.55.0 Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Bard Liao [ Upstream commit 569922b82ca660f8b24e705f6cf674e6b1f99cc7 ] Each cpu DAI should associate with a widget. However, the topology might not create the right number of DAI widgets for aggregated amps. And it will cause NULL pointer deference. Check that the DAI widget associated with the CPU DAI is valid to prevent NULL pointer deference due to missing DAI widgets in topologies with aggregated amps. Signed-off-by: Bard Liao Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Liam Girdwood Link: https://patch.msgid.link/20241203104853.56956-1-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown Assisted-by: LLM [ Backport to 6.6.y: Keep the NULL-widget checks in sdw_hda_dai_hw_params() and sdw_params_stream(). Omit the extra check in the newer IPC4 CPU-DAI aggregation loop, which this target lacks. ] Signed-off-by: Artem Dinaburg --- Hi, Please consider this backport of the fix for CVE-2024-58012 to 6.6.y. The two NULL-widget guards are identical to upstream; the additional IPC4 CPU-DAI aggregation-loop guard is omitted because 6.6.y has no corresponding loop. The complete fix is already present in 6.12.y, 6.18.y and 7.2.y. Build-tested only as part of a cumulative 6.6.y series: x86_64 objects (allmodconfig, CONFIG_WERROR=y); no runtime testing. Thanks, Artem Dinaburg sound/soc/sof/intel/hda-dai.c | 6 ++++++ sound/soc/sof/intel/hda.c | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/sound/soc/sof/intel/hda-dai.c b/sound/soc/sof/intel/hda-dai.c index a3d0b6d721aaf6fa47d58053b6eead49af4e94d8..f541cd0fe78a40c85e37d90937dae77cf0fa429b 100644 --- a/sound/soc/sof/intel/hda-dai.c +++ b/sound/soc/sof/intel/hda-dai.c @@ -454,6 +454,12 @@ int sdw_hda_dai_hw_params(struct snd_pcm_substream *substream, struct snd_sof_dev *sdev; int ret; + if (!w) { + dev_err(cpu_dai->dev, "%s widget not found, check amp link num in the topology\n", + cpu_dai->name); + return -EINVAL; + } + ret = non_hda_dai_hw_params(substream, params, cpu_dai); if (ret < 0) { dev_err(cpu_dai->dev, "%s: non_hda_dai_hw_params failed %d\n", __func__, ret); diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index 15e6779efaa3bcc9e0dc16e6a92271930eba7a0f..aa3f9c961173715507b35e236d996f2751774ea3 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -102,6 +102,11 @@ static int sdw_params_stream(struct device *dev, struct snd_soc_dapm_widget *w = snd_soc_dai_get_widget(d, params_data->substream->stream); struct snd_sof_dai_config_data data = { 0 }; + if (!w) { + dev_err(dev, "%s widget not found, check amp link num in the topology\n", + d->name); + return -EINVAL; + } data.dai_index = (params_data->link_id << 8) | d->id; data.dai_data = params_data->alh_stream_id;