From patchwork Thu Jun 1 03:33:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?VHJldm9yIFd1ICjlkLPmlofoia8p?= X-Patchwork-Id: 13262970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 E2DCFC77B7A for ; Thu, 1 Jun 2023 03:34:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=/dVEf+T1aWW4TNL1MVxg/4odK7RXTPb0ghml4vXo3Wo=; b=GwTgMSgC21BkPmy6w8IN0K/L6F XpcXTJuOfQ6rKx1GRPQqosM0ZV7FuFB8LgL0un+wKMDndA33fItoDUDJIMfE2RPeLH2WbRlcCwIyk JnjE/v9ueNxPJH3gCzqk/O+OlylHPNU3hZlznKugC9zOBDM1cHIYRXr3LgpvAKS1njXmixwQvz7xy cXVDuY9dS7Rmjvz/Qo5DXtz8JEgrPu5NTLU9XbbQKn9sFg9i0qfdiY6qglbts8p9NQ9nOmi+ca/Rd UnGcYCgrnH1hd2yGhCuDG2i4lGcSTwx2EuAsHpEOTtOov7VbF0d/2DfCIBEBV9ZJ3w6ZFCp1QqBrW QlXy53aQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q4Z4c-001pda-0q; Thu, 01 Jun 2023 03:34:02 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q4Z4Z-001pcV-0b; Thu, 01 Jun 2023 03:34:00 +0000 X-UUID: 22d844da002d11ee912e1518a6540028-20230531 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=/dVEf+T1aWW4TNL1MVxg/4odK7RXTPb0ghml4vXo3Wo=; b=O8ZeFTK97s6FKOREnJolH29I7/WXDhRVzXe3h4giYBmeUw20Hfa5By0NDIn/qWGQTboFgoQ1b8k4d6KkG9vWcBhw8xKxMK+/TvH+20VYvyar8f0EDiSbh375JjrhYMknaXR/XYF2vxva6AUU33GSsYt2xA9wWq+YZhcTtKJ4Jz0=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.25,REQID:8825572d-82f6-4e4a-b88b-c2e6ea805157,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:90 X-CID-INFO: VERSION:1.1.25,REQID:8825572d-82f6-4e4a-b88b-c2e6ea805157,IP:0,URL :0,TC:0,Content:-5,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTIO N:quarantine,TS:90 X-CID-META: VersionHash:d5b0ae3,CLOUDID:9cbca86d-2f20-4998-991c-3b78627e4938,B ulkID:2306011133209ODVQYT1,BulkQuantity:2,Recheck:0,SF:38|29|28|17|19|48,T C:nil,Content:0,EDM:-3,IP:nil,URL:1,File:nil,Bulk:40,QS:nil,BEC:nil,COL:0, OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-UUID: 22d844da002d11ee912e1518a6540028-20230531 Received: from mtkmbs13n1.mediatek.inc [(172.21.101.193)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1072240071; Wed, 31 May 2023 20:33:55 -0700 Received: from mtkmbs11n1.mediatek.inc (172.21.101.186) by mtkmbs13n2.mediatek.inc (172.21.101.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Thu, 1 Jun 2023 11:33:19 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Thu, 1 Jun 2023 11:33:19 +0800 From: Trevor Wu To: , , , , , CC: , , , , , Subject: [PATCH v2 0/2] ASoC: mediatek: fix use-after-free in driver remove path Date: Thu, 1 Jun 2023 11:33:16 +0800 Message-ID: <20230601033318.10408-1-trevor.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230531_203359_228593_213C3BC7 X-CRM114-Status: UNSURE ( 8.56 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org These patches concern modifications made in mt8186[1]. The clock unregistration mechanism used in mt8188 and mt8195 is similar with mt8186, resulting in the same problem existing within the driver. Therefore, the solution has also been applied to these two platforms. [1] https://lore.kernel.org/all/20230511092437.1.I31cceffc8c45bb1af16eb613e197b3df92cdc19e@changeid/ Changes since v1: - remove unnecessary cast Trevor Wu (2): ASoC: mediatek: mt8188: fix use-after-free in driver remove path ASoC: mediatek: mt8195: fix use-after-free in driver remove path sound/soc/mediatek/mt8188/mt8188-afe-clk.c | 7 --- sound/soc/mediatek/mt8188/mt8188-afe-clk.h | 1 - sound/soc/mediatek/mt8188/mt8188-afe-pcm.c | 4 -- sound/soc/mediatek/mt8188/mt8188-audsys-clk.c | 47 ++++++++++--------- sound/soc/mediatek/mt8188/mt8188-audsys-clk.h | 1 - sound/soc/mediatek/mt8195/mt8195-afe-clk.c | 5 -- sound/soc/mediatek/mt8195/mt8195-afe-clk.h | 1 - sound/soc/mediatek/mt8195/mt8195-afe-pcm.c | 4 -- sound/soc/mediatek/mt8195/mt8195-audsys-clk.c | 47 ++++++++++--------- sound/soc/mediatek/mt8195/mt8195-audsys-clk.h | 1 - 10 files changed, 48 insertions(+), 70 deletions(-)