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=1796045569; b=fzuNJfqu8ThkvwFoDMceoQ6baFjUfOuoe6ZUPc/1YmoiFsB6OfpqHRFGrTS76PRlGQUN MF8E2qs0p9vaNKJvXLvTJXVxK15tFjirL+o9rpWzQzsPACqnS/Ni5LMdXzGn0FGGYUl+j GrtyWQ/uNCpD1bVjoJXKrao+HTVxpRdTq6twYeZWG+ceS721CIgxR83HORHvv0Z0n0siI DG0NnD1sjjx1Zrvc3YoWtYel6ApN1MMfqVk9CcvXXwJQRnQUt2jSZbd+s78BqzmE9tzuh JqdU6T+lusNYWVMvWO5NlM34qCupYMzHOiPJ1c/sj5ydT0yGyEuFmWVsLTYCWwwj76w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796045569; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=vqqyXM6jyflzl1u3JJbNHnyOWfVk56Hb8nkDDtWiQQE=; b=k27zuDmRx/vYyu6OKDxeWsYmBRI9G5bQrtQ3vLaAN6GwQI6LaAKr+61KeESeC42xpY6+ 32cVxlHmkIRTz6129VbOL9m5Poh+AT/aQXLbxkh0XVLX/xpTgo0DluKo0qtRVKW9SpPM7 HoEKW4Ge04IPsB8YWMnMQM6DgIX/RZ4ArS2oYk4nT93ubfWQmdTHYoMo3cvxfd3ORal7L WbcSOJTrM5e5cHv+J41vYWkyOf8zkekTCUVirAyyPwAQU0UXxao0/BeZobEaQ87HJ6Ibi DDzcpawelr5eeHpQFX5sfSieD3Le/Kap1fNT7z/bXuV7Y9u2blaHvwzEG0itNkIZPiQ== 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=TV183nYJ; 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 2A60D606A330 for ; Mon, 30 Nov 2026 13:32:49 +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=TV183nYJ Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3E2D1F0089C; Mon, 30 Nov 2026 13:32:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796045568; bh=vqqyXM6jyflzl1u3JJbNHnyOWfVk56Hb8nkDDtWiQQE=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=TV183nYJESuLLvo2lkZzoWetm1lSUM5cBTgO4Vb226h1IounJ1fgOqr36NuHimnFk BS4SUIQoOozZJQCdyzqKFV9neXc65pxXfK7zMFv6v9d+5/HxrSdiG3LzxZHGiIFsID bc+0pMFbX81JYL/NLh+vR8COKCkzsFF+BU4F07Xno3+z+Zl1axBEb+tIhn0q2BzaG5 V0QLA/32mUhXr2IBEKmhBwEP/cXmvUZQ5bbqF4VliUKbLGt1bZfig1MfCN1g53sgi+ QkQW2eqQ4F6zOJkL6tklo0OnF9nNJJxyUrGJFX5ydWYbbPPGxQk6tjpBzD/CTVgV68 FWRSd82qKUiUg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] ASoC: rt5645: stop timer and delayed works on probe error Reply-To: sashiko-reviews@lists.linux.dev To: "Yaohan Li" Cc: linux-sound@vger.kernel.org In-Reply-To: <20261130132808.2078478-1-shunsheng1218@gmail.com> References: <20261130132808.2078478-1-shunsheng1218@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Mon, 30 Nov 2026 13:32:48 +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: rt5645: use-after-free in rt5645_jack_detect_work() [1] -- commit 6c5cfa8c0e2764c399b0e7cada712cfd7e7eb7a6 Author: Yaohan Li ASoC: rt5645: stop timer and delayed works on probe error This commit shuts down btn_check_timer and cancels jack_detect_work and rcclock_work on the err_irq path in rt5645_i2c_probe() if component registration fails. > diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c > index e14b66d3118da..dbbd12e637e7b 100644 > --- a/sound/soc/codecs/rt5645.c > +++ b/sound/soc/codecs/rt5645.c > @@ -4282,6 +4282,9 @@ static int rt5645_i2c_probe(struct i2c_client *i2c) > err_irq: > if (rt5645->i2c->irq) > free_irq(rt5645->i2c->irq, rt5645); > + timer_shutdown_sync(&rt5645->btn_check_timer); > + cancel_delayed_work_sync(&rt5645->jack_detect_work); > + cancel_delayed_work_sync(&rt5645->rcclock_work); [Severity: Critical] This problem wasn't introduced by this patch, but can rt5645_remove() trigg= er a similar use-after-free in rt5645_jack_detect_work() [1] when the ASoC sound card is unbound while the I2C device remains bound? sound/soc/codecs/rt5645.c:rt5645_remove() { struct rt5645_priv *rt5645 =3D snd_soc_component_get_drvdata(component); rt5645_reset(component); kfree(rt5645->eq_param); rt5645->eq_param =3D NULL; } When the sound card is unbound, the ASoC core frees the component and machine driver jack structures, but rt5645_remove() neither clears rt5645->component nor stops btn_check_timer and jack_detect_work. Because the I2C IRQ remains active, a subsequent jack interrupt queues rt5645_jack_detect_work(), which sees the dangling rt5645->component pointer and dereferences the freed component and jack structures in rt5645_jack_detect() and snd_soc_jack_report(). [1] https://sashiko.dev/#/bug/linux-adf839ae-82ba-4d0b-86a4-d5a143d295a8 --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261130132808.2078= 478-1-shunsheng1218@gmail.com?part=3D1