mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 02:19:51 +00:00
wifi: mac80211: check for station first in client probe
[ Upstream commit 67dfa589aa
]
When probing a client, first check if we have it, and then
check for the channel context, otherwise you can trigger
the warning there easily by probing when the AP isn't even
started yet. Since a client existing means the AP is also
operating, we can then keep the warning.
Also simplify the moved code a bit.
Reported-by: syzbot+999fac712d84878a7379@syzkaller.appspotmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
9433221090
commit
7dce2deb0b
1 changed files with 8 additions and 7 deletions
|
@ -4133,19 +4133,20 @@ static int ieee80211_probe_client(struct wiphy *wiphy, struct net_device *dev,
|
||||||
mutex_lock(&local->mtx);
|
mutex_lock(&local->mtx);
|
||||||
|
|
||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
|
sta = sta_info_get_bss(sdata, peer);
|
||||||
|
if (!sta) {
|
||||||
|
ret = -ENOLINK;
|
||||||
|
goto unlock;
|
||||||
|
}
|
||||||
|
|
||||||
|
qos = sta->sta.wme;
|
||||||
|
|
||||||
chanctx_conf = rcu_dereference(sdata->vif.bss_conf.chanctx_conf);
|
chanctx_conf = rcu_dereference(sdata->vif.bss_conf.chanctx_conf);
|
||||||
if (WARN_ON(!chanctx_conf)) {
|
if (WARN_ON(!chanctx_conf)) {
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto unlock;
|
goto unlock;
|
||||||
}
|
}
|
||||||
band = chanctx_conf->def.chan->band;
|
band = chanctx_conf->def.chan->band;
|
||||||
sta = sta_info_get_bss(sdata, peer);
|
|
||||||
if (sta) {
|
|
||||||
qos = sta->sta.wme;
|
|
||||||
} else {
|
|
||||||
ret = -ENOLINK;
|
|
||||||
goto unlock;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (qos) {
|
if (qos) {
|
||||||
fc = cpu_to_le16(IEEE80211_FTYPE_DATA |
|
fc = cpu_to_le16(IEEE80211_FTYPE_DATA |
|
||||||
|
|
Loading…
Reference in a new issue