From patchwork Mon Jun 3 10:28:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 801277 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EAE68C25B75 for ; Mon, 3 Jun 2024 10:28:29 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 1C030A4A; Mon, 3 Jun 2024 12:28:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1C030A4A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1717410506; bh=zBoxYI6e7jUZhIXNajNwuL7GZWLuUWbRagMWTsGHiYw=; h=From:To:Cc:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=k/OJBT+2OSkIX8Rs6mFbNr/o4CyOSkCTo8oJoIHZulMbV+HA5rydZm+72M3+ZeYMA 1oMxjAKMyyyMkZng4Cf+/bw6z1t0PeFJBZJW4zeTLJU/zKGh1hrA7bt8dFEBtP+yLt RMdXns13k3QqxaOB0rjZgMWMwD1kYIdnE+1+TpVI= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 513B7F8055C; Mon, 3 Jun 2024 12:27:54 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id A69B7F804B2; Mon, 3 Jun 2024 12:27:53 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2A046F80496; Mon, 3 Jun 2024 12:27:47 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C87D7F800AC for ; Mon, 3 Jun 2024 12:27:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C87D7F800AC Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=lpv3KZgv DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717410462; x=1748946462; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=zBoxYI6e7jUZhIXNajNwuL7GZWLuUWbRagMWTsGHiYw=; b=lpv3KZgvNG5jXE0umhsW5zLXgcJsYL2xjmQ6EJDG7HSljyt/7FsXRUwh quxE8LXPToBtHI+fj3mXFt8GHzEVXOTSDe9DVe97G+q9X6GAztssbMT6r bZSNWGlItKre/atl/H3JROAvgdqRe2BKaQyrHGnSxLBeYHH/YluvJ72ED i6x9kHmkUkkh+943der92/sfKwP0f+j2i9Bt6h3+MRNorGawN8pggX+W7 mpWZ+fQDhMRx+P/pjthyHSIzhE7rIcBmswZsU4GUwiBu1g91nEFsvRnKi irGHRZqgzhIUtH5TcA1D/0nLH5SRM9CnbIqMlrSM8agjptr3MpO1pXWqa g==; X-CSE-ConnectionGUID: /EfOM6CrQrOodOkBZ+tiQA== X-CSE-MsgGUID: IDCTp8c2QLCpguBE+wIg7w== X-IronPort-AV: E=McAfee;i="6600,9927,11091"; a="14017207" X-IronPort-AV: E=Sophos;i="6.08,211,1712646000"; d="scan'208";a="14017207" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 03:27:38 -0700 X-CSE-ConnectionGUID: rsOKqC1QT3+FO0PRqs5TDw== X-CSE-MsgGUID: 7quXLN8ATrm7UcgR4JiezA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,211,1712646000"; d="scan'208";a="37430029" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by orviesa008.jf.intel.com with ESMTP; 03 Jun 2024 03:27:35 -0700 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Mark Brown Cc: Cezary Rojewski , Pierre-Louis Bossart , Ranjani Sridharan , Takashi Iwai , Jaroslav Kysela , alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, Jason Montleon , =?utf-8?q?Amadeusz_S=C5=82awi=C5=84sk?= =?utf-8?q?i?= Subject: [PATCH 0/4] ASoC: topology: Fix route memory corruption Date: Mon, 3 Jun 2024 12:28:14 +0200 Message-Id: <20240603102818.36165-1-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Message-ID-Hash: C4NBXKXADCMN2PB36XIMEJ3VUCY3QIFX X-Message-ID-Hash: C4NBXKXADCMN2PB36XIMEJ3VUCY3QIFX X-MailFrom: amadeuszx.slawinski@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Originally reported here: https://github.com/thesofproject/avs-topology-xml/issues/22#issuecomment-2127892605 There is various level of failure there, first of all when topology loads routes, it points directly into FW file, but it may be freed after topology load. After fixing the above, when avs driver parses topology it should allocate its own memory, as target strings can be shorter than needed. Also clean up soc_tplg_dapm_graph_elems_load() a bit. Amadeusz Sławiński (4): ASoC: topology: Fix references to freed memory ASoC: Intel: avs: Fix route override ASoC: topology: Do not assign fields that are already set ASoC: topology: Clean up route loading sound/soc/intel/avs/topology.c | 19 ++++++++++++---- sound/soc/soc-topology.c | 41 ++++++++++++++++++---------------- 2 files changed, 37 insertions(+), 23 deletions(-)