Unverified Commit 4833a7b5 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!15132 CVE-2024-56607 fix

Merge Pull Request from: @ci-robot 
 
PR sync from: Gu Bowen <gubowen5@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/22YBAHL5MSNUVPYGFTVHKIZKFR45HMYD/ 
CVE-2024-56607

Kalle Valo (1):
  wifi: ath12k: fix atomic calls in ath12k_mac_op_set_bitrate_mask()

Rory Little (1):
  wifi: mac80211: Add non-atomic station iterator


-- 
2.25.1
 
https://gitee.com/src-openeuler/kernel/issues/IBEAO4 
 
Link:https://gitee.com/openeuler/kernel/pulls/15132

 

Reviewed-by: default avatarZhang Peng <zhangpeng362@huawei.com>
Signed-off-by: default avatarZhang Peng <zhangpeng362@huawei.com>
parents 05b1d1a4 66221a88
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -6676,7 +6676,7 @@ ath12k_mac_op_set_bitrate_mask(struct ieee80211_hw *hw,
				    arvif->vdev_id, ret);
			return ret;
		}
		ieee80211_iterate_stations_atomic(ar->hw,
		ieee80211_iterate_stations_mtx(ar->hw,
					       ath12k_mac_disable_peer_fixed_rate,
					       arvif);
	} else if (ath12k_mac_bitrate_mask_get_single_nss(ar, band, mask,
@@ -6722,14 +6722,14 @@ ath12k_mac_op_set_bitrate_mask(struct ieee80211_hw *hw,
			return -EINVAL;
		}

		ieee80211_iterate_stations_atomic(ar->hw,
		ieee80211_iterate_stations_mtx(ar->hw,
					       ath12k_mac_disable_peer_fixed_rate,
					       arvif);

		mutex_lock(&ar->conf_mutex);

		arvif->bitrate_mask = *mask;
		ieee80211_iterate_stations_atomic(ar->hw,
		ieee80211_iterate_stations_mtx(ar->hw,
					       ath12k_mac_set_bitrate_mask_iter,
					       arvif);

+18 −0
Original line number Diff line number Diff line
@@ -6080,6 +6080,24 @@ void ieee80211_iterate_stations_atomic(struct ieee80211_hw *hw,
				       void (*iterator)(void *data,
						struct ieee80211_sta *sta),
				       void *data);

/**
 * ieee80211_iterate_stations_mtx - iterate stations
 *
 * This function iterates over all stations associated with a given
 * hardware that are currently uploaded to the driver and calls the callback
 * function for them. This version can only be used while holding the wiphy
 * mutex.
 *
 * @hw: the hardware struct of which the interfaces should be iterated over
 * @iterator: the iterator function to call
 * @data: first argument of the iterator function
 */
void ieee80211_iterate_stations_mtx(struct ieee80211_hw *hw,
				    void (*iterator)(void *data,
						     struct ieee80211_sta *sta),
				    void *data);

/**
 * ieee80211_queue_work - add work onto the mac80211 workqueue
 *
+15 −1
Original line number Diff line number Diff line
@@ -827,7 +827,8 @@ static void __iterate_stations(struct ieee80211_local *local,
{
	struct sta_info *sta;

	list_for_each_entry_rcu(sta, &local->sta_list, list) {
	list_for_each_entry_rcu(sta, &local->sta_list, list,
				lockdep_is_held(&local->hw.wiphy->mtx)) {
		if (!sta->uploaded)
			continue;

@@ -848,6 +849,19 @@ void ieee80211_iterate_stations_atomic(struct ieee80211_hw *hw,
}
EXPORT_SYMBOL_GPL(ieee80211_iterate_stations_atomic);

void ieee80211_iterate_stations_mtx(struct ieee80211_hw *hw,
				    void (*iterator)(void *data,
						     struct ieee80211_sta *sta),
				    void *data)
{
	struct ieee80211_local *local = hw_to_local(hw);

	lockdep_assert_wiphy(local->hw.wiphy);

	__iterate_stations(local, iterator, data);
}
EXPORT_SYMBOL_GPL(ieee80211_iterate_stations_mtx);

struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev)
{
	struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);