aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorStanislaw Gruszka <sgruszka@redhat.com>2011-04-20 09:57:14 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-04-20 16:05:59 -0400
commitb25026981aecde3685dd0e45ad980fff9f528daa (patch)
treedb9972ab6095d6bd57978d734810e26c733338ee /drivers
parent243e6df4ed919880d079d717641ad699c6530a03 (diff)
iwlwifi: fix skb usage after free
Since commit a120e912eb51e347f36c71b60a1d13af74d30e83 Author: Stanislaw Gruszka <sgruszka@redhat.com> Date: Fri Feb 19 15:47:33 2010 -0800 iwlwifi: sanity check before counting number of tfds can be free we use skb->data after calling ieee80211_tx_status_irqsafe(), which could free skb instantly. On current kernels I do not observe practical problems related with bug, but on 2.6.35.y it cause random system hangs when stressing wireless link. Cc: stable@kernel.org # 2.6.32+ Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-tx.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
index a709d05c586..2dd7d54a796 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
@@ -1224,12 +1224,16 @@ int iwlagn_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index)
1224 q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) { 1224 q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) {
1225 1225
1226 tx_info = &txq->txb[txq->q.read_ptr]; 1226 tx_info = &txq->txb[txq->q.read_ptr];
1227 iwlagn_tx_status(priv, tx_info, 1227
1228 txq_id >= IWLAGN_FIRST_AMPDU_QUEUE); 1228 if (WARN_ON_ONCE(tx_info->skb == NULL))
1229 continue;
1229 1230
1230 hdr = (struct ieee80211_hdr *)tx_info->skb->data; 1231 hdr = (struct ieee80211_hdr *)tx_info->skb->data;
1231 if (hdr && ieee80211_is_data_qos(hdr->frame_control)) 1232 if (ieee80211_is_data_qos(hdr->frame_control))
1232 nfreed++; 1233 nfreed++;
1234
1235 iwlagn_tx_status(priv, tx_info,
1236 txq_id >= IWLAGN_FIRST_AMPDU_QUEUE);
1233 tx_info->skb = NULL; 1237 tx_info->skb = NULL;
1234 1238
1235 if (priv->cfg->ops->lib->txq_inval_byte_cnt_tbl) 1239 if (priv->cfg->ops->lib->txq_inval_byte_cnt_tbl)