]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.32.17/iwlagn-verify-flow-id-in-compressed-ba-packet.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.32.17 / iwlagn-verify-flow-id-in-compressed-ba-packet.patch
1 From b561e8274f75831ee87e4ea378cbb1f9f050a51a Mon Sep 17 00:00:00 2001
2 From: Shanyu Zhao <shanyu.zhao@intel.com>
3 Date: Tue, 1 Jun 2010 17:13:58 -0700
4 Subject: iwlagn: verify flow id in compressed BA packet
5
6 From: Shanyu Zhao <shanyu.zhao@intel.com>
7
8 commit b561e8274f75831ee87e4ea378cbb1f9f050a51a upstream.
9
10 The flow id (scd_flow) in a compressed BA packet should match the txq_id
11 of the queue from which the aggregated packets were sent. However, in
12 some hardware like the 1000 series, sometimes the flow id is 0 for the
13 txq_id (10 to 19). This can cause the annoying message:
14 [ 2213.306191] iwlagn 0000:01:00.0: Received BA when not expected
15 [ 2213.310178] iwlagn 0000:01:00.0: Read index for DMA queue txq id (0),
16 index 5, is out of range [0-256] 7 7.
17
18 And even worse, if agg->wait_for_ba is true when the bad BA is arriving,
19 this can cause system hang due to NULL pointer dereference because the
20 code is operating in a wrong tx queue!
21
22 Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com>
23 Signed-off-by: Pradeep Kulkarni <pradeepx.kulkarni@intel.com>
24 Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
25 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
26
27 ---
28 drivers/net/wireless/iwlwifi/iwl-tx.c | 5 +++++
29 1 file changed, 5 insertions(+)
30
31 --- a/drivers/net/wireless/iwlwifi/iwl-tx.c
32 +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
33 @@ -1479,6 +1479,11 @@ void iwl_rx_reply_compressed_ba(struct i
34 sta_id = ba_resp->sta_id;
35 tid = ba_resp->tid;
36 agg = &priv->stations[sta_id].tid[tid].agg;
37 + if (unlikely(agg->txq_id != scd_flow)) {
38 + IWL_ERR(priv, "BA scd_flow %d does not match txq_id %d\n",
39 + scd_flow, agg->txq_id);
40 + return;
41 + }
42
43 /* Find index just before block-ack window */
44 index = iwl_queue_dec_wrap(ba_resp_scd_ssn & 0xff, txq->q.n_bd);