]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: nl80211: hold wdev mutex for tid config
authorJohannes Berg <johannes.berg@intel.com>
Mon, 27 Jun 2022 10:43:37 +0000 (12:43 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 13:16:20 +0000 (15:16 +0200)
commit 206bbcf76121664e95a42e1c014c3fe168d07a3d upstream.

We need wdev_chandef() in this code, which now requires
the wdev mutex due to the per-link nature. Hold it here
to make sure we can access the link.

Reported-by: syzbot+b4e9aa0f32ffd9902442@syzkaller.appspotmail.com
Fixes: 7b0a0e3c3a88 ("wifi: cfg80211: do some rework towards MLO link APIs")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/wireless/nl80211.c

index d0ba3e646ec6e369a35a116c9e44eccc37fab978..4a0ea67e385f272d98b1b871a06e1497dba1b846 100644 (file)
@@ -15285,6 +15285,8 @@ static int nl80211_set_tid_config(struct sk_buff *skb,
        if (info->attrs[NL80211_ATTR_MAC])
                tid_config->peer = nla_data(info->attrs[NL80211_ATTR_MAC]);
 
+       wdev_lock(dev->ieee80211_ptr);
+
        nla_for_each_nested(tid, info->attrs[NL80211_ATTR_TID_CONFIG],
                            rem_conf) {
                ret = nla_parse_nested(attrs, NL80211_TID_CONFIG_ATTR_MAX,
@@ -15306,6 +15308,7 @@ static int nl80211_set_tid_config(struct sk_buff *skb,
 
 bad_tid_conf:
        kfree(tid_config);
+       wdev_unlock(dev->ieee80211_ptr);
        return ret;
 }