From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796152960; b=l65xrfOHh6GyKfZ8tlysVDgTEYyyMi1/BMTqfQocOHqENYybKviRgNKSLbYftWEbiAzK i4oui1dK7O4/ozzAGb+IdN3uo0iMh1jkjck+/EeeiP6p3y8kdtkOVMuqoF8pVMEdTz61B eXBQVAoWvtrO0Jx4KoCq1Wg4Yd1vU6J0CmP3Yc5UiL5bznX59u7XVjWYLZ7pVot5OQTHV ZkBhz1d737crC/T5blAL8HenUbcEIUSx0AKXgFTAdgQGTbHB8noILdkM2L0uVpM8lfg7b 0mxfLJ/Rx+xFfTPebaMUi5yDI94LaTKAEO21Imf4RRUF+fd3LQUW0wWMHXNzp7Z6kvw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796152960; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=M5t6ngiM4mMso1WKI8/6zLU8Ji8w75Vez7TDERC0c8g=; b=Jvdt000Awo2FaJi9nFuRbcSsfNVQCxE2IRWVBrHu+ZDyelxchilbXmtBQkT+X5m2bKy6 V5ZM+/yUW6g+238rxBzEnPF7S2iJk6wdxvwjnPYpDxpQmHGRuTve9SToDJEYqt/4CT1UQ wUMRVh6PsMWjRllG8S5xlWVKcqzfps2xiCwh97cB7JbytL+Jm74xUTUXik8ALNwdpiUkB DNFf8lYUON+K/I/qnh+iiVkJxhs055Xz9YoG4DvuEGedUN0GHN4+tHOHCx79vIY2YHhwa SvWrrYSvBx9NLjw+94trI8ochC+ktD4Sgy3LmTOD6YwPxFLbG+5Um4144P5m3usMaUA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=kLEkE9KO; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 139D0606A31A for ; Tue, 1 Dec 2026 19:22:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=kLEkE9KO Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7447D1F000C1; Tue, 1 Dec 2026 19:22:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796152959; bh=M5t6ngiM4mMso1WKI8/6zLU8Ji8w75Vez7TDERC0c8g=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=kLEkE9KOn8OOqa3cS3dFtT5PcJs9ZsnAX2u4GPWqTH3jQEWFHTg2llcOf5ctQYpAD +tQV+ChU8HiD/RW76oPVwT8saORrrkeTuPbXTgEAESmoZhx0u3jZ/S23IiPBBMtMd1 A82WUXv2vd3WTZZ4ZEvEzm3gOP7dyysVg23/Q2UXwOUZ5seGkt04dKsP64wpXIjS4c 0bosSyN6gbdqa+1mYbvWhFvYjE8y+yrsxPtedGNGPtFsWU7Sp+F2dRl96YuNFxXwWm h1stXtfhuFSdyHRx6TmvvtXZwVz4pDSBjnp58bkANksJpMeQAWLXj3X0RQExD5qAgw nWJH200ZCVV7Q== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 4/6] ASoC: es9356: disable runtime PM in remove unconditionally Reply-To: sashiko-reviews@lists.linux.dev To: "Arina Kharlamova" Cc: linux-sound@vger.kernel.org In-Reply-To: <20261201-s2p-asoc-rpm-v1-4-477189293ad4@mbzuai.ac.ae> References: <20261201-s2p-asoc-rpm-v1-0-477189293ad4@mbzuai.ac.ae> <20261201-s2p-asoc-rpm-v1-4-477189293ad4@mbzuai.ac.ae> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 19:22:39 +0000 X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found no new issues in this patch, but noticed 1 related pre-existing issue it does not introduce: - [Critical] ASoC: es9356: use-after-free in es9356_sdw_remove() [1] -- commit 528ed0d483b59e2d6fe68475201f8a4df4ccb91d Author: Arina Kharlamova ASoC: es9356: disable runtime PM in remove unconditionally This commit removes the first_hw_init check before pm_runtime_disable() in es9356_sdw_remove() so runtime PM is always disabled when the driver is unbound. > diff --git a/sound/soc/codecs/es9356.c b/sound/soc/codecs/es9356.c > index cc69336dff79e..267db423b6913 100644 > --- a/sound/soc/codecs/es9356.c > +++ b/sound/soc/codecs/es9356.c > @@ -1150,8 +1150,7 @@ static void es9356_sdw_remove(struct sdw_slave *sla= ve) > cancel_delayed_work_sync(&es9356->button_detect_work); > } > =20 > - if (es9356->first_hw_init) > - pm_runtime_disable(&slave->dev); > + pm_runtime_disable(&slave->dev); [Severity: Critical] This problem wasn't introduced by this patch, but can guarding the work cancellation above with es9356->hw_init cause a use-after-free [1] when unattach races with driver unbind? When es9356_sdw_update_status() handles SDW_SLAVE_UNATTACHED, it clears es9356->hw_init before canceling interrupt_handle_work and button_detect_work: CPU0 CPU1 es9356_sdw_update_status() es9356->hw_init =3D false; es9356_sdw_remove() if (es9356->hw_init) // false // devres frees es9356 cancel_delayed_work_sync(...) <-- use-after-free Because es9356_sdw_remove() skips canceling the delayed works and returns, devres frees es9356 while es9356_sdw_update_status() or the pending work handlers still access it. Both delayed works are initialized in es9356_sdca_init() at probe time, so es9356_sdw_remove() can cancel them unconditionally. [1] https://sashiko.dev/#/bug/linux-70b198a2-7241-42b4-a17a-72e02648f7c0 --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201-s2p-asoc-r= pm-v1-0-477189293ad4@mbzuai.ac.ae?part=3D4