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 C0D8223B612; Mon, 23 Mar 2026 14:47:47 +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=1774277267; cv=none; b=iZdr1dJmulPTke3oHyrUFJrzsh5H9SaN4Y1hMYMiiOJ/Vxkdb5BW5w5Wog1pd+UckRPMnrKYwKyARWrVamC5Cr78jzjEWmOH1NiK7k8sDUop1KXBxbAYLTdaFud/Gm/MK/yCYfPiXL/VoepJNQmykaQZfNuaQ6cv9Cm0RC6jZUE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774277267; c=relaxed/simple; bh=jrSvoygXL3NizDn8AVMc2UON2diNtrSAmKlaL+iijGQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VZXyDXsz9QEmJvJw5uzW1V2ZxeLPTsLKWrrfrvdk4tBANttcFI+n4rhYQWKosWGbGoTlgMqDBDuODjiTEOuz+i4baBkIQhgXdx1SrFDHRUjqAce7MlLuW/pFpcOYprv6uAL+zjGkYEx/15FVnQ7bc6V4SBxn+WoGzKlSDueATkM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ZnCDVfNu; 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="ZnCDVfNu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5DB54C2BC9E; Mon, 23 Mar 2026 14:47:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774277267; bh=jrSvoygXL3NizDn8AVMc2UON2diNtrSAmKlaL+iijGQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZnCDVfNuDrxL3G9QfAJ0hRQp4Vx1N5v9J6KfGPTU0oyqIgAhS4IHeZOyJF70QQcs8 +G3aQHSHsKMXr1vSe2yjENWx/ZD8Rb7BuVnBa3XN0LCacYRVgPliSUjcE4BRLtsU1+ pQTqMdDbLmjyzlyv7Ug0+S6rtJ55bAg1nluOMyds= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Peddolla Harshavardhan Reddy , Johannes Berg , Sasha Levin Subject: [PATCH 6.12 375/460] wifi: cfg80211: cancel pmsr_free_wk in cfg80211_pmsr_wdev_down Date: Mon, 23 Mar 2026 14:46:11 +0100 Message-ID: <20260323134535.780726847@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260323134526.647552166@linuxfoundation.org> References: <20260323134526.647552166@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Peddolla Harshavardhan Reddy [ Upstream commit 6dccbc9f3e1d38565dff7730d2b7d1e8b16c9b09 ] When the nl80211 socket that originated a PMSR request is closed, cfg80211_release_pmsr() sets the request's nl_portid to zero and schedules pmsr_free_wk to process the abort asynchronously. If the interface is concurrently torn down before that work runs, cfg80211_pmsr_wdev_down() calls cfg80211_pmsr_process_abort() directly. However, the already- scheduled pmsr_free_wk work item remains pending and may run after the interface has been removed from the driver. This could cause the driver's abort_pmsr callback to operate on a torn-down interface, leading to undefined behavior and potential crashes. Cancel pmsr_free_wk synchronously in cfg80211_pmsr_wdev_down() before calling cfg80211_pmsr_process_abort(). This ensures any pending or in-progress work is drained before interface teardown proceeds, preventing the work from invoking the driver abort callback after the interface is gone. Fixes: 9bb7e0f24e7e ("cfg80211: add peer measurement with FTM initiator API") Signed-off-by: Peddolla Harshavardhan Reddy Link: https://patch.msgid.link/20260305160712.1263829-3-peddolla.reddy@oss.qualcomm.com Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/wireless/pmsr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/wireless/pmsr.c b/net/wireless/pmsr.c index 0396fa19bdf19..d2b61b6ba58db 100644 --- a/net/wireless/pmsr.c +++ b/net/wireless/pmsr.c @@ -647,6 +647,7 @@ void cfg80211_pmsr_wdev_down(struct wireless_dev *wdev) } spin_unlock_bh(&wdev->pmsr_lock); + cancel_work_sync(&wdev->pmsr_free_wk); if (found) cfg80211_pmsr_process_abort(wdev); -- 2.51.0