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 DF02A38D415 for ; Tue, 12 May 2026 12:22:04 +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=1778588525; cv=none; b=ukOsjT8RvKewyf2GzcO+x7NjUbCOxXytRakFx5oilR5lRGb30lGZRhD4pRVIGbgYJectjAs97x+xT9lvBM+zbCsUFo3GB1eeJCk7Ty7RW2ZKfjouolbGZSdgeiJDMslGPIoTWg803Pi9D0722JtZAhaPmVD6dyU3QCfxvU0Vbxs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778588525; c=relaxed/simple; bh=0K7qyZf24CjIpaYM0CbPdwhCxHsW7p/l4LqkFHVyYJU=; h=Subject:To:Cc:From:Date:Message-ID; b=E8uwAU6oWsU3vjQtFV84LUzZXecknHDp2Y8EMkPP9V1L5dTKfKcpdwSckn98xiL8q9L2BXMv1qenyKSotezP7Gxvm5ED3TejBgBfPzXZoDZSjLN86+NU8zEdrEH/zkQXnIMp3bbEfLUPkozro560wFPnUXH37OhNp+n/R7lTCIw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Ok9Y20s5; 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="Ok9Y20s5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AEAFAC2BCB0; Tue, 12 May 2026 12:22:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778588524; bh=0K7qyZf24CjIpaYM0CbPdwhCxHsW7p/l4LqkFHVyYJU=; h=Subject:To:Cc:From:Date:From; b=Ok9Y20s5otkS/TIGOWiI7APYkKwu0VsxxRWnD81Yx1y34iTPoz8f9EyFm/pVFDzm7 5cF6t22YosK3IGbsRpTi5KB4dAWt5bBKuaW82LlTakSWbvkr0m+Bub2SRRjeSOK0GR 3aSwJfYTLZO/9yDuWaGYkol9TeXJVAwD9a1sYu84= Subject: FAILED: patch "[PATCH] wifi: brcmfmac: Fix potential use-after-free issue when" failed to apply to 6.1-stable tree To: m.szyprowski@samsung.com,arend.vanspriel@broadcom.com,johannes.berg@intel.com Cc: From: Date: Tue, 12 May 2026 14:22:06 +0200 Message-ID: <2026051206-scalded-clone-94cb@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The patch below does not apply to the 6.1-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-6.1.y git checkout FETCH_HEAD git cherry-pick -x c623b63580880cc742255eaed3d79804c1b91143 # git commit -s git send-email --to '' --in-reply-to '2026051206-scalded-clone-94cb@gregkh' --subject-prefix 'PATCH 6.1.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; }