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=1796380130; b=UD/SiQ/qtQxm/w4vXTGQ+REJ1otzUHhOWPA+34lQyAgSScBpZ+IfOdvCFotOUgJIkIiX rD/WqdBaWY+JNPKj9tzgHwt80zHuXpYkp79/ShFIWahdU7uVwhVpfbpxI3nXHS27KibyI OgRZnNq8lO9b93dQXY9PJpUZp66nrw3hk8Tchz20eUsdY8eytzjOfo/gUEYh4jhcWNDFM +YzTsk5BmJSr0mVGcftETdJuZ3pTfdBPkec+0hvjPo5v5+rYtNJZdihrhfOBuUebSZjlx G8nPj4DgqkZsAAKpfElYG4/WQETvK4q2OMQouywRujmTgA48iSfInRxkzz6Su13rxpA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380130; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=5/FzwOZ4kG5QRIxgu7THOaceR2+TdAZq+QsAhMCtQw0=; b=0Xkfk5IXbQDcG71dXqorXErdFYsPGIUCDeVQoJ+/Ghspa+u4gd8wybxEjdQfu6QK4MGn +4Skyc/EvhfAr2/PIZ4QjiTqJY4AHlVDN96S4SOleEnayHcZQ2ewqR4OwR91j0bWAMgqC z+6UGXMMXaLTqkB9gEFAiqG/8Jaoa2+sbh/BrBEoI6+M8204CWGZOmP68HunpPmcSAXeC ZYcXuEJM0+OyA8C6DVL7wJCbOE3eSyCm13AlSqMqtfTmi9JZrb36RmZnuqf3szEgYejkA JWDRqA9H7dn6jIiPoWWgl9AREAP4gTdhznyNsFYLqwHZ7C8yHJKSIeSeFQ/S+QI1AdA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=XaH7f6O0; 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 688E7606A322; Fri, 4 Dec 2026 10:28:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=XaH7f6O0 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8106B1F000C2; Fri, 4 Dec 2026 10:28:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796380129; bh=5/FzwOZ4kG5QRIxgu7THOaceR2+TdAZq+QsAhMCtQw0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=XaH7f6O0SdGC3W2pFBRN0njxeyYZsm03xtKI/gN9bRj9uiVARvZX60EXX+u8MsNkK qijh8ZyhRoq59vi819Fz4Q2xL+o2wTt2oT8PWGkbLPuS05R1QDORDSZ1BACMC4Kcr7 iD6nP5yRklObK98lrmbsU4yAQNHj5TcYustHkun4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, syzbot+e91dc13b1b37759b3d9f@syzkaller.appspotmail.com, =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= , Eduard Zateev , Johannes Berg , Sasha Levin Subject: [PATCH 7.3 088/742] wifi: ath9k: make sure we stop the wmi tasklet on init fail Date: Fri, 4 Dec 2026 18:59:12 +0900 Message-ID: <20261204100637.448241397@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Toke Høiland-Jørgensen [ Upstream commit ec95877e2ea1c655e914c34fa23fd51e32315fec ] The ath9k_wmi_event_tasklet() reschedules itself until device initialisation is complete, but if the initialisation fails it is never interrupted. Syzbot triggered a use-after-free in tasklet_action_common because of this. Add a guard to the reschedule logic so it aborts if wmi->stopped is set, and add a call to ath9k_wmi_event_drain() in ath9k_stop_wmi(), so we are sure that the queue is drained and the tasklet is stopped on teardown. Fixes: 1af8dc9ca726 ("wifi: ath9k: Clean up device initialisation guards") Reported-by: syzbot+e91dc13b1b37759b3d9f@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=e91dc13b1b37759b3d9f Tested-by: syzbot+e91dc13b1b37759b3d9f@syzkaller.appspotmail.com Signed-off-by: Toke Høiland-Jørgensen Tested-by: Eduard Zateev Link: https://patch.msgid.link/20261021120237.481898-1-toke@toke.dk Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath9k/wmi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath9k/wmi.c b/drivers/net/wireless/ath/ath9k/wmi.c index 44e91815a1594..520bb2347dfcd 100644 --- a/drivers/net/wireless/ath/ath9k/wmi.c +++ b/drivers/net/wireless/ath/ath9k/wmi.c @@ -118,6 +118,8 @@ void ath9k_stop_wmi(struct ath9k_htc_priv *priv) mutex_lock(&wmi->op_mutex); wmi->stopped = true; mutex_unlock(&wmi->op_mutex); + + ath9k_wmi_event_drain(priv); } void ath9k_destroy_wmi(struct ath9k_htc_priv *priv) @@ -148,7 +150,8 @@ void ath9k_wmi_event_tasklet(struct tasklet_struct *t) /* Check if ath9k_init_device() completed. */ if (!smp_load_acquire(&priv->initialized)) { - tasklet_schedule(t); + if (!READ_ONCE(wmi->stopped)) + tasklet_schedule(t); return; } -- 2.53.0