From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 6D014386441; Wed, 23 Sep 2026 14:40:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790174414; cv=none; b=BWx/NPg2X3uE33jEk/XjdKv6AMvOIa8QaVbFlSComA6l8Kg/Pm7KoKyRuBCCrmIj4H3TCqMq0Rs+ATRRm33j0h1HDZRYnrYri+rJ4CPsmWrM41YQ9VyBksB5fWeeJml3nyNIkEXWDoai59ttA7GETADOFNVnIJ5cvNJ5Zr1Kao0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790174414; c=relaxed/simple; bh=jbBPUQGuaJzpF26vnT/LtxOATd4J58Lf6kWkMYltTHc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uY9WDL3nih+z2w7zcNHs5UT4yH/x0R/+ygfwekoOGXRW5UQip8tOiWBOtquN0qIhHH67pKONOX3+TqlHoX2MJgLRxkb0/4Bpw/yGNk3kSpEpOYmfbUqnDgZGzqOXes6+Y1tMVQ92NHfbQtv67PJEELs2i7rgt+Vg7Br7bPbC7oc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=bLfMyeTN; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="bLfMyeTN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B81881F000FF; Wed, 23 Sep 2026 14:40:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790174413; bh=vpp/CjvjYKOqK+XBDp3bvbi4DkWoYVvftSgf1NfVrmE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=bLfMyeTNXy2Fgr07pWQRpzKik7eJYXYGOHW0YqAcSIfIQzhWKHq4QeU14B3ruMuGn hjA9+LjB4G+4Z1JQTBpUI0rHQJigMeT/Jir2avtlyyU2k4WDHXr535KgOaAjocnNqR f9yIpmUtlkjb1t8YN5ua1JlqYeYpOYK4J1A3lN4o= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, syzbot+e55106f8389651870be0@syzkaller.appspotmail.com, Johannes Berg , Sasha Levin Subject: [PATCH 6.18 075/398] wifi: mac80211: require a peer station for TDLS setup confirm Date: Wed, 23 Sep 2026 16:02:29 +0200 Message-ID: <20260923140645.376195089@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260923140643.441954610@linuxfoundation.org> References: <20260923140643.441954610@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.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johannes Berg [ Upstream commit 038e1d126304fd25d507fd4e671232df57bd1799 ] It's nonsense for the setup confirm to go to station that doesn't even exist, and it hits a warning when building the frame: WARN_ON_ONCE(!sta || !ap_sta) Only accept WLAN_TDLS_SETUP_CONFIRM when the station is already there as a TDLS station. Need to copy the call to ieee80211_tdls_prep_mgmt_packet() since the existing WLAN_TDLS_DISCOVERY_REQUEST already falls through to it. Assisted-by: LLM Fixes: 6f7eaa47e1de ("mac80211: add TDLS QoS param IE on setup-confirm") Reported-by: syzbot+e55106f8389651870be0@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=e55106f8389651870be0 Link: https://patch.msgid.link/20260908122838.201719-15-johannes@sipsolutions.net Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/tdls.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c index 1536cd71878c7..1dde37ad8bb20 100644 --- a/net/mac80211/tdls.c +++ b/net/mac80211/tdls.c @@ -1285,6 +1285,24 @@ int ieee80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev, peer_capability, initiator, extra_ies, extra_ies_len); break; + case WLAN_TDLS_SETUP_CONFIRM: { + struct sta_info *sta; + + sta = sta_info_get(sdata, peer); + if (!sta || !sta->sta.tdls) { + ret = -ENOLINK; + break; + } + + ret = ieee80211_tdls_prep_mgmt_packet(wiphy, dev, peer, + link_id, action_code, + dialog_token, + status_code, + peer_capability, + initiator, extra_ies, + extra_ies_len, 0, NULL); + break; + } case WLAN_TDLS_DISCOVERY_REQUEST: /* * Protect the discovery so we can hear the TDLS discovery @@ -1293,7 +1311,6 @@ int ieee80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev, */ drv_mgd_protect_tdls_discover(sdata->local, sdata, link_id); fallthrough; - case WLAN_TDLS_SETUP_CONFIRM: case WLAN_PUB_ACTION_TDLS_DISCOVER_RES: /* no special handling */ ret = ieee80211_tdls_prep_mgmt_packet(wiphy, dev, peer, -- 2.53.0