Commit eb507906 authored by David S. Miller's avatar David S. Miller
Browse files

Merge tag 'mac80211-for-net-2020-01-15' of...

Merge tag 'mac80211-for-net-2020-01-15' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211



Johannes Berg says:

====================
A few fixes:
 * -O3 enablement fallout, thanks to Arnd who ran this
 * fixes for a few leaks, thanks to Felix
 * channel 12 regulatory fix for custom regdomains
 * check for a crash reported by syzbot
   (NULL function is called on drivers that don't have it)
 * fix TKIP replay protection after setup with some APs
   (from Jouni)
 * restrict obtaining some mesh data to avoid WARN_ONs
 * fix deadlocks with auto-disconnect (socket owner)
 * fix radar detection events with multiple devices
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 8c4df83f 81c044fc
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -3548,6 +3548,9 @@ struct cfg80211_update_owe_info {
 *
 * @start_radar_detection: Start radar detection in the driver.
 *
 * @end_cac: End running CAC, probably because a related CAC
 *	was finished on another phy.
 *
 * @update_ft_ies: Provide updated Fast BSS Transition information to the
 *	driver. If the SME is in the driver/firmware, this information can be
 *	used in building Authentication and Reassociation Request frames.
@@ -3874,6 +3877,8 @@ struct cfg80211_ops {
					 struct net_device *dev,
					 struct cfg80211_chan_def *chandef,
					 u32 cac_time_ms);
	void	(*end_cac)(struct wiphy *wiphy,
				struct net_device *dev);
	int	(*update_ft_ies)(struct wiphy *wiphy, struct net_device *dev,
				 struct cfg80211_update_ft_ies_params *ftie);
	int	(*crit_proto_start)(struct wiphy *wiphy,
+23 −0
Original line number Diff line number Diff line
@@ -2954,6 +2954,28 @@ static int ieee80211_start_radar_detection(struct wiphy *wiphy,
	return err;
}

static void ieee80211_end_cac(struct wiphy *wiphy,
			      struct net_device *dev)
{
	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
	struct ieee80211_local *local = sdata->local;

	mutex_lock(&local->mtx);
	list_for_each_entry(sdata, &local->interfaces, list) {
		/* it might be waiting for the local->mtx, but then
		 * by the time it gets it, sdata->wdev.cac_started
		 * will no longer be true
		 */
		cancel_delayed_work(&sdata->dfs_cac_timer_work);

		if (sdata->wdev.cac_started) {
			ieee80211_vif_release_channel(sdata);
			sdata->wdev.cac_started = false;
		}
	}
	mutex_unlock(&local->mtx);
}

static struct cfg80211_beacon_data *
cfg80211_beacon_dup(struct cfg80211_beacon_data *beacon)
{
@@ -4023,6 +4045,7 @@ const struct cfg80211_ops mac80211_config_ops = {
#endif
	.get_channel = ieee80211_cfg_get_channel,
	.start_radar_detection = ieee80211_start_radar_detection,
	.end_cac = ieee80211_end_cac,
	.channel_switch = ieee80211_channel_switch,
	.set_qos_map = ieee80211_set_qos_map,
	.set_ap_chanwidth = ieee80211_set_ap_chanwidth,
+3 −0
Original line number Diff line number Diff line
@@ -328,6 +328,9 @@ u32 airtime_link_metric_get(struct ieee80211_local *local,
	unsigned long fail_avg =
		ewma_mesh_fail_avg_read(&sta->mesh->fail_avg);

	if (sta->mesh->plink_state != NL80211_PLINK_ESTAB)
		return MAX_METRIC;

	/* Try to get rate based on HW/SW RC algorithm.
	 * Rate is returned in units of Kbps, correct this
	 * to comply with airtime calculation units
+15 −3
Original line number Diff line number Diff line
@@ -263,9 +263,21 @@ int ieee80211_tkip_decrypt_data(struct arc4_ctx *ctx,
	if ((keyid >> 6) != key->conf.keyidx)
		return TKIP_DECRYPT_INVALID_KEYIDX;

	if (rx_ctx->ctx.state != TKIP_STATE_NOT_INIT &&
	    (iv32 < rx_ctx->iv32 ||
	     (iv32 == rx_ctx->iv32 && iv16 <= rx_ctx->iv16)))
	/* Reject replays if the received TSC is smaller than or equal to the
	 * last received value in a valid message, but with an exception for
	 * the case where a new key has been set and no valid frame using that
	 * key has yet received and the local RSC was initialized to 0. This
	 * exception allows the very first frame sent by the transmitter to be
	 * accepted even if that transmitter were to use TSC 0 (IEEE 802.11
	 * described TSC to be initialized to 1 whenever a new key is taken into
	 * use).
	 */
	if (iv32 < rx_ctx->iv32 ||
	    (iv32 == rx_ctx->iv32 &&
	     (iv16 < rx_ctx->iv16 ||
	      (iv16 == rx_ctx->iv16 &&
	       (rx_ctx->iv32 || rx_ctx->iv16 ||
		rx_ctx->ctx.state != TKIP_STATE_NOT_INIT)))))
		return TKIP_DECRYPT_REPLAY;

	if (only_iv) {
+3 −0
Original line number Diff line number Diff line
@@ -10843,6 +10843,7 @@ static int cfg80211_cqm_rssi_update(struct cfg80211_registered_device *rdev,
		if (err)
			return err;

		cfg80211_sinfo_release_content(&sinfo);
		if (sinfo.filled & BIT_ULL(NL80211_STA_INFO_BEACON_SIGNAL_AVG))
			wdev->cqm_config->last_rssi_event_value =
				(s8) sinfo.rx_beacon_signal_avg;
@@ -13796,6 +13797,8 @@ static int nl80211_probe_mesh_link(struct sk_buff *skb, struct genl_info *info)
	if (err)
		return err;

	cfg80211_sinfo_release_content(&sinfo);

	return rdev_probe_mesh_link(rdev, dev, dest, buf, len);
}

Loading