From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 83D6C56458; Thu, 13 Jun 2024 12:10:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718280635; cv=none; b=JKvUqtGdGziFSta72gKwS8cXykp4mnriu/nbldyRepbMa85+1zVzUPKDyQVx4UedkVhP3S4eETrtneHmnoXpyOPYMS0wKR/+lpF2ktRZMeBGd4J3a5Nsp8A94MeAxDltPmRbR4NHvqOhC5YzekBVZaRltfNA6qMsQDg9f4Khk1I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718280635; c=relaxed/simple; bh=w48OD1Lb4vgIiD9PdS/ZiVW8jdq1fq1Nz/TE1ARxX+M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=noTKJJkHMZWKFXqprz7Nu65GZBMFqqeG8w7s5N5rYPazI/lXFXRDz/rA+jSD8y+9ukNd1z7yrM3YgHvuGqlPCNMnm+Z7Vun9q1Hfs6LrD+INcAzAY7t83vbnkheOj+50APd0H391otN/FHLh+mqUJUnpGR5Bv8W0wUNjQa6HtKU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=nlPHrohh; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="nlPHrohh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C597C2BBFC; Thu, 13 Jun 2024 12:10:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718280635; bh=w48OD1Lb4vgIiD9PdS/ZiVW8jdq1fq1Nz/TE1ARxX+M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nlPHrohh5tMwFtwO3K2jN1lpx+nDftQmveNWZdDp9q8F2xZMiYwGwmQqj9brlcZzB aTUp2gYceSIaIljZ9YVlTerQY/vrhT2ZQAbXHPYsRAYXfiHRrxMzuG8ApghIw6I21P 0nbnhPv5weCcHVgnl9kq8CDki992/9fEItNORMUk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Peter Ujfalusi , Pierre-Louis Bossart , Seppo Ingalsuo , Ranjani Sridharan , Mark Brown Subject: [PATCH 6.6 121/137] ASoC: SOF: ipc4-topology: Fix input format query of process modules without base extension Date: Thu, 13 Jun 2024 13:35:01 +0200 Message-ID: <20240613113227.993708793@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240613113223.281378087@linuxfoundation.org> References: <20240613113223.281378087@linuxfoundation.org> User-Agent: quilt/0.67 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.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Peter Ujfalusi commit ffa077b2f6ad124ec3d23fbddc5e4b0ff2647af8 upstream. If a process module does not have base config extension then the same format applies to all of it's inputs and the process->base_config_ext is NULL, causing NULL dereference when specifically crafted topology and sequences used. Fixes: 648fea128476 ("ASoC: SOF: ipc4-topology: set copier output format for process module") Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Seppo Ingalsuo Reviewed-by: Ranjani Sridharan Cc: stable@vger.kernel.org Link: https://msgid.link/r/20240529121201.14687-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/sof/ipc4-topology.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/sound/soc/sof/ipc4-topology.c +++ b/sound/soc/sof/ipc4-topology.c @@ -195,6 +195,14 @@ sof_ipc4_get_input_pin_audio_fmt(struct } process = swidget->private; + + /* + * For process modules without base config extension, base module config + * format is used for all input pins + */ + if (process->init_config != SOF_IPC4_MODULE_INIT_CONFIG_TYPE_BASE_CFG_WITH_EXT) + return &process->base_config.audio_fmt; + base_cfg_ext = process->base_config_ext; /*