From: "Péter Ujfalusi" <peter.ujfalusi@linux.intel.com>
To: Chen-Yu Tsai <wenst@chromium.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Bard Liao <yung-chuan.liao@linux.intel.com>,
Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
Daniel Baluta <daniel.baluta@nxp.com>,
Kai Vehmanen <kai.vehmanen@linux.intel.com>,
Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>
Cc: sound-open-firmware@alsa-project.org,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
linux-mediatek@lists.infradead.org
Subject: Re: [PATCH] ASoC: SOF: Fix function topology name check in profile info output
Date: Thu, 23 Oct 2025 09:39:28 +0300 [thread overview]
Message-ID: <a464eb64-4c07-41d0-989a-bdc9eaae9acf@linux.intel.com> (raw)
In-Reply-To: <20251023061226.1127345-1-wenst@chromium.org>
On 23/10/2025 09:12, Chen-Yu Tsai wrote:
> The function topology feature, and the plat_data->machine field that
> specifies this feature, is ACPI specific. The check didn't take this
> into consideration, which causes a NULL pointer dereference splat on
> OF platforms:
>
> BUG: KASAN: null-ptr-deref in sof_create_ipc_file_profile (sound/soc/sof/fw-file-profile.c:291 sound/soc/sof/fw-file-profile.c:340) snd_sof
> Read of size 8 at addr 00000000000000c8 by task (udev-worker)/247
>
> CPU: 7 UID: 0 PID: 247 Comm: (udev-worker) Not tainted 6.18.0-rc2-next-20251023-03804-g93b191bc0c26-dirty #747 PREEMPT ba3c303a11d89508de4087cb5b4f8985b6d87b6f
> Hardware name: Google Ciri sku2 board (DT)
> Call trace:
> [KASAN stuff]
> sof_create_ipc_file_profile (sound/soc/sof/fw-file-profile.c:291 sound/soc/sof/fw-file-profile.c:340) snd_sof
> snd_sof_device_probe (sound/soc/sof/core.c:304 sound/soc/sof/core.c:388 sound/soc/sof/core.c:460 sound/soc/sof/core.c:719) snd_sof
> sof_of_probe (sound/soc/sof/sof-of-dev.c:84) snd_sof_of
> platform_probe (drivers/base/platform.c:1405)
> [...]
>
> Check that the ACPI specific field is actually valid before accessing
> it.
>
> This was seen on a MediaTek based Chromebook.
Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
>
> Fixes: 2b92b98cc476 ("ASoC: SOF: Don't print the monolithic topology name if function topology may be used")
> Cc: Bard Liao <yung-chuan.liao@linux.intel.com>
> Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
> ---
> sound/soc/sof/fw-file-profile.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/sound/soc/sof/fw-file-profile.c b/sound/soc/sof/fw-file-profile.c
> index 4a2afc04f338..76bde2e0be1d 100644
> --- a/sound/soc/sof/fw-file-profile.c
> +++ b/sound/soc/sof/fw-file-profile.c
> @@ -288,7 +288,8 @@ static void sof_print_profile_info(struct snd_sof_dev *sdev,
> if (profile->fw_lib_path)
> dev_info(dev, " Firmware lib path: %s\n", profile->fw_lib_path);
>
> - if (plat_data->machine->get_function_tplg_files && !plat_data->disable_function_topology)
> + if (plat_data->machine && plat_data->machine->get_function_tplg_files &&
> + !plat_data->disable_function_topology)
> dev_info(dev, " Topology file: function topologies\n");
> else
> dev_info(dev, " Topology file: %s/%s\n",
--
Péter
next prev parent reply other threads:[~2025-10-23 6:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-23 6:12 [PATCH] ASoC: SOF: Fix function topology name check in profile info output Chen-Yu Tsai
2025-10-23 6:39 ` Péter Ujfalusi [this message]
2025-10-23 21:14 ` Mark Brown
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=a464eb64-4c07-41d0-989a-bdc9eaae9acf@linux.intel.com \
--to=peter.ujfalusi@linux.intel.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=broonie@kernel.org \
--cc=daniel.baluta@nxp.com \
--cc=kai.vehmanen@linux.intel.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-sound@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=perex@perex.cz \
--cc=pierre-louis.bossart@linux.dev \
--cc=ranjani.sridharan@linux.intel.com \
--cc=sound-open-firmware@alsa-project.org \
--cc=tiwai@suse.com \
--cc=wenst@chromium.org \
--cc=yung-chuan.liao@linux.intel.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;
as well as URLs for NNTP newsgroup(s).