wifi: mac80211: lock wiphy for aggregation debugfs
authorJohannes Berg <johannes.berg@intel.com>
Mon, 28 Aug 2023 11:59:31 +0000 (13:59 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 11 Sep 2023 09:27:18 +0000 (11:27 +0200)
To change aggregation status may call into the driver,
lock the wiphy for this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/debugfs_sta.c

index 5a97fb248c85ce84239c12dc9bdce9b2f4518c48..06e3613bf46bd918a69ff3d50cfa1411d466e4a8 100644 (file)
@@ -5,7 +5,7 @@
  * Copyright 2007      Johannes Berg <johannes@sipsolutions.net>
  * Copyright 2013-2014  Intel Mobile Communications GmbH
  * Copyright(c) 2016 Intel Deutschland GmbH
- * Copyright (C) 2018 - 2022 Intel Corporation
+ * Copyright (C) 2018 - 2023 Intel Corporation
  */
 
 #include <linux/debugfs.h>
@@ -420,6 +420,7 @@ static ssize_t sta_agg_status_write(struct file *file, const char __user *userbu
        if (ret || tid >= IEEE80211_NUM_TIDS)
                return -EINVAL;
 
+       wiphy_lock(sta->local->hw.wiphy);
        if (tx) {
                if (start)
                        ret = ieee80211_start_tx_ba_session(&sta->sta, tid,
@@ -431,6 +432,7 @@ static ssize_t sta_agg_status_write(struct file *file, const char __user *userbu
                                               3, true);
                ret = 0;
        }
+       wiphy_unlock(sta->local->hw.wiphy);
 
        return ret ?: count;
 }