Skip to content

Commit

Permalink
iwl4965: fix skb usage after free
Browse files Browse the repository at this point in the history
Since

commit a120e91
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, making bisection of other problems impossible.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Stanislaw Gruszka authored and John W. Linville committed Apr 20, 2011
1 parent b250269 commit 069f40f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions drivers/net/wireless/iwlegacy/iwl-4965-tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1127,12 +1127,16 @@ int iwl4965_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index)
q->read_ptr = iwl_legacy_queue_inc_wrap(q->read_ptr, q->n_bd)) {

tx_info = &txq->txb[txq->q.read_ptr];
iwl4965_tx_status(priv, tx_info,
txq_id >= IWL4965_FIRST_AMPDU_QUEUE);

if (WARN_ON_ONCE(tx_info->skb == NULL))
continue;

hdr = (struct ieee80211_hdr *)tx_info->skb->data;
if (hdr && ieee80211_is_data_qos(hdr->frame_control))
if (ieee80211_is_data_qos(hdr->frame_control))
nfreed++;

iwl4965_tx_status(priv, tx_info,
txq_id >= IWL4965_FIRST_AMPDU_QUEUE);
tx_info->skb = NULL;

priv->cfg->ops->lib->txq_free_tfd(priv, txq);
Expand Down

0 comments on commit 069f40f

Please sign in to comment.