]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commitdiff
wifi: mac80211: check tdls flag in ieee80211_tdls_oper
authorDeepanshu Kartikey <kartikey406@gmail.com>
Fri, 13 Mar 2026 09:24:17 +0000 (14:54 +0530)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 13 Mar 2026 13:51:38 +0000 (14:51 +0100)
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: syzbot+56b6a844a4ea74487b7b@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=56b6a844a4ea74487b7b
Tested-by: syzbot+56b6a844a4ea74487b7b@syzkaller.appspotmail.com
Suggested-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
Link: https://patch.msgid.link/20260313092417.520807-1-kartikey406@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/tdls.c

index dbbfe2d6842fbec2f3fcc063470482b98781cbba..1dca2fae05a5217e6b63bae8812f890bfa463be6 100644 (file)
@@ -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);