From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C1E736729B for ; Tue, 12 May 2026 12:22:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778588532; cv=none; b=Jh84k1zlHA3TfpEpcrG5/HSIWLjh7WnzBYm1+QU1v2hu8Dn/t0KbTqjfyRoosPUoNegisNe6X7/Q9Qlhx+g2OzUCvBuwm7pL6VbzAqKpHc0ZPduhM4rKCGaJFUXZ0XFV0niXIRDcmWTT6MvlC7qBktZtekRiyPjnnrKvyrtvtcU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778588532; c=relaxed/simple; bh=I1fmUDP1RsftXzx4T00IJXBUfPalmi6ThuNVluPrL4A=; h=Subject:To:Cc:From:Date:Message-ID; b=Ib86XqdAxBfgES6hivDDXeymTIZdpIoR9SGl/vdL/vd0rhdaPYqHl7Ubtwn76emAGbeIhx4ihNecGxApqiEygU9oCmJT/e9aYfrdrO8Da+bs5n7EMnhqcnuN9CziyPeFUiwlhwUBNsjyBukiQ/W7c4aWpssaXVqtJdvIfiuVHD0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Nm0aKqxC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Nm0aKqxC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45A3DC2BCB0; Tue, 12 May 2026 12:22:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778588532; bh=I1fmUDP1RsftXzx4T00IJXBUfPalmi6ThuNVluPrL4A=; h=Subject:To:Cc:From:Date:From; b=Nm0aKqxC1eVUSbKDmJTUfgUEqvwInEJoegicWYxTrI6Ai01nXv7XxG3FasBLHNkQt FlxmcuYI7tRXNhF/5mUm91sbLoqvOt2Kkl7uBHeD9muYdGBo1U8+rGF19k8hHBSZdJ mlJnBhuqnG6djku+rm9I2uuIHIGbZOeksoHabFhk= Subject: FAILED: patch "[PATCH] wifi: brcmfmac: Fix potential use-after-free issue when" failed to apply to 5.10-stable tree To: m.szyprowski@samsung.com,arend.vanspriel@broadcom.com,johannes.berg@intel.com Cc: From: Date: Tue, 12 May 2026 14:22:07 +0200 Message-ID: <2026051207-user-eastcoast-1614@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The patch below does not apply to the 5.10-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y git checkout FETCH_HEAD git cherry-pick -x c623b63580880cc742255eaed3d79804c1b91143 # git commit -s git send-email --to '' --in-reply-to '2026051207-user-eastcoast-1614@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From c623b63580880cc742255eaed3d79804c1b91143 Mon Sep 17 00:00:00 2001 From: Marek Szyprowski Date: Thu, 16 Apr 2026 11:33:39 +0200 Subject: [PATCH] wifi: brcmfmac: Fix potential use-after-free issue when stopping watchdog task Watchdog task might end between send_sig() and kthread_stop() calls, what results in the use-after-free issue. Fix this by increasing watchdog task reference count before calling send_sig() and dropping it by switching to kthread_stop_put(). Cc: stable@vger.kernel.org Fixes: 373c83a801f1 ("brcmfmac: stop watchdog before detach and free everything") Fixes: a9ffda88be74 ("brcm80211: fmac: abstract bus_stop interface function pointer") Signed-off-by: Marek Szyprowski Acked-by: Arend van Spriel Link: https://patch.msgid.link/20260416093339.2066829-1-m.szyprowski@samsung.com Signed-off-by: Johannes Berg diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index 30f6fcb68632..8fb595733b9c 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -2476,8 +2476,9 @@ static void brcmf_sdio_bus_stop(struct device *dev) brcmf_dbg(TRACE, "Enter\n"); if (bus->watchdog_tsk) { + get_task_struct(bus->watchdog_tsk); send_sig(SIGTERM, bus->watchdog_tsk, 1); - kthread_stop(bus->watchdog_tsk); + kthread_stop_put(bus->watchdog_tsk); bus->watchdog_tsk = NULL; } @@ -4567,8 +4568,9 @@ void brcmf_sdio_remove(struct brcmf_sdio *bus) if (bus) { /* Stop watchdog task */ if (bus->watchdog_tsk) { + get_task_struct(bus->watchdog_tsk); send_sig(SIGTERM, bus->watchdog_tsk, 1); - kthread_stop(bus->watchdog_tsk); + kthread_stop_put(bus->watchdog_tsk); bus->watchdog_tsk = NULL; }