wifi: mac80211: check tdls flag in ieee80211_tdls_oper
PATCH v2 1/1 wifi: mac80211: check tdls flag in ieee80211_tdls_oper
When NL80211_TDLS_ENABLE_LINK is called, the code only checks if the station exists but not whether it is actually a TDLS station. This allows the operation to proceed for non-TDLS stations, causing unintended side effects like modifying channel context and HT protection before failing.
Add a check for sta->sta.tdls early in the ENABLE_LINK case, before any side effects occur, to ensure the operation is only allowed for actual TDLS peers.
Reported-by [email protected]
Tested-by [email protected]
Suggested-by Johannes Berg <[email protected]>
Signed-off-by Deepanshu Kartikey <[email protected]>
---
v2: Instead of replacing WARN_ON_ONCE with tdls_peer address check,
add early check for sta->sta.tdls flag before any side effects occur, as suggested by Johannes Berg.
--- net/mac80211/tdls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/tdls.c +1 -1
@@ -1449,7 +1449,7 @@ int ieee80211_tdls_oper(struct wiphy *wiphy, struct net_device *dev, } sta =sta_info_get (sdata, peer); -if (!sta) +if (!sta || !sta->sta.tdls)return -ENOLINK ;iee80211_tdls_recalc_chanctx (sdata, sta);
Signature · 1 line
2.43.0