1
0
Fork 0

Fourth batch of patches intended for v5.1

* Fix an oops when we receive a packet with bogus lengths;
 * Fix a bug that prevented 5350 devices from working;
 * Fix a small merge damage from the previous series;
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEF3LNfgb2BPWm68smoUecoho8xfoFAlzFUJAACgkQoUecoho8
 xfrECg//ejBGSZuq4XcyJB6H9In8Dz/VCgDrH6pOgQqREEvlmezhHRK5rtua/Kn7
 FxVe99hzu2JJqKbvji5S2E5xsABqBjobcZYqhGuIPSzKV14DkA8F9swXDN4MOKnc
 uWCb/iBcNPYYwu7tN4vo1LyJUeofPG4Mdn1kQ+YNAanXQ7lIiKEqZ2mw6U3iAWMG
 Om8RSBBmcexT7nC25eVEbnrYQ6pNs9V5uXSyZ8JLZL6vGkhc3pGBfsPyAjQ0EuKs
 L4yWj3DgOunuA1Ruh/fPNu5n4Fk7EK62H7TDC0SPecYuwlgLyU6pcWPBdGlsYC2Z
 +kV6D2AquL7R9N16ZsYoimU5N3AQeCvI6QWFkasYR91Zos8dbarCAGa9jB6/hpWq
 MnrtAqy6Ea4WupmooFwpFZc+RAhr6BPiQS6dv1KkhDBA9W3Nrc6m0EUQU9gSkQaB
 aq9vOvpZjRja+NbUX3cWw1QDXuabEIgx3TBurmxA6Mb+j25aa00kzkvqD6PvNJnM
 JaPc8enNjDiIZVvsoemTxh6GKpz+WQXz7yBh0ndynByDv7XuXtRyhr0MC2+o+oL6
 3oFYw0qjczl6DPtOrbEq7PQL+iq8muz14I3FrJfkEvYyCU6KHyvE+dJDxod7A7SQ
 ulpV8cL98Eq9XDMf/6bPowJGjgzAgQr7Odc8EZKmZKDjb2E7aC4=
 =7QM5
 -----END PGP SIGNATURE-----

Merge tag 'iwlwifi-for-kalle-2019-04-28' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes

Fourth batch of patches intended for v5.1

* Fix an oops when we receive a packet with bogus lengths;
* Fix a bug that prevented 5350 devices from working;
* Fix a small merge damage from the previous series;
hifive-unleashed-5.1
Kalle Valo 2019-04-28 14:25:33 +03:00
commit 5c403533fb
3 changed files with 26 additions and 11 deletions

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved.
* Copyright(c) 2018 Intel Corporation
* Copyright(c) 2018 - 2019 Intel Corporation
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
@ -136,6 +136,7 @@ const struct iwl_cfg iwl5350_agn_cfg = {
.ht_params = &iwl5000_ht_params,
.led_mode = IWL_LED_BLINK,
.internal_wimax_coex = true,
.csr = &iwl_csr_v1,
};
#define IWL_DEVICE_5150 \

View File

@ -780,12 +780,6 @@ void iwl_mvm_vif_dbgfs_register(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
return;
}
if (!mvmvif->dbgfs_dir) {
IWL_ERR(mvm, "Failed to create debugfs directory under %pd\n",
dbgfs_dir);
return;
}
if (iwlmvm_mod_params.power_scheme != IWL_POWER_SCHEME_CAM &&
((vif->type == NL80211_IFTYPE_STATION && !vif->p2p) ||
(vif->type == NL80211_IFTYPE_STATION && vif->p2p)))

View File

@ -169,9 +169,9 @@ static inline int iwl_mvm_check_pn(struct iwl_mvm *mvm, struct sk_buff *skb,
}
/* iwl_mvm_create_skb Adds the rxb to a new skb */
static void iwl_mvm_create_skb(struct sk_buff *skb, struct ieee80211_hdr *hdr,
u16 len, u8 crypt_len,
struct iwl_rx_cmd_buffer *rxb)
static int iwl_mvm_create_skb(struct iwl_mvm *mvm, struct sk_buff *skb,
struct ieee80211_hdr *hdr, u16 len, u8 crypt_len,
struct iwl_rx_cmd_buffer *rxb)
{
struct iwl_rx_packet *pkt = rxb_addr(rxb);
struct iwl_rx_mpdu_desc *desc = (void *)pkt->data;
@ -204,6 +204,20 @@ static void iwl_mvm_create_skb(struct sk_buff *skb, struct ieee80211_hdr *hdr,
* present before copying packet data.
*/
hdrlen += crypt_len;
if (WARN_ONCE(headlen < hdrlen,
"invalid packet lengths (hdrlen=%d, len=%d, crypt_len=%d)\n",
hdrlen, len, crypt_len)) {
/*
* We warn and trace because we want to be able to see
* it in trace-cmd as well.
*/
IWL_DEBUG_RX(mvm,
"invalid packet lengths (hdrlen=%d, len=%d, crypt_len=%d)\n",
hdrlen, len, crypt_len);
return -EINVAL;
}
skb_put_data(skb, hdr, hdrlen);
skb_put_data(skb, (u8 *)hdr + hdrlen + pad_len, headlen - hdrlen);
@ -216,6 +230,8 @@ static void iwl_mvm_create_skb(struct sk_buff *skb, struct ieee80211_hdr *hdr,
skb_add_rx_frag(skb, 0, rxb_steal_page(rxb), offset,
fraglen, rxb->truesize);
}
return 0;
}
static void iwl_mvm_add_rtap_sniffer_config(struct iwl_mvm *mvm,
@ -1671,7 +1687,11 @@ void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi,
rx_status->boottime_ns = ktime_get_boot_ns();
}
iwl_mvm_create_skb(skb, hdr, len, crypt_len, rxb);
if (iwl_mvm_create_skb(mvm, skb, hdr, len, crypt_len, rxb)) {
kfree_skb(skb);
goto out;
}
if (!iwl_mvm_reorder(mvm, napi, queue, sta, skb, desc))
iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, queue,
sta, csi);