diff options
author | Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> | 2012-01-21 04:52:52 -0500 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2012-01-24 07:12:27 -0500 |
commit | 3fdc099109e75359e5de54c56478c06255850741 (patch) | |
tree | 90875415bcc1fb09f2f9ad838e9bbf3c4a17cb52 /drivers/net | |
parent | 17741c8db4f53200a51600d1644ee6a2b76f0984 (diff) |
ath6kl: Fix bug in using tid given by addba/delba req events
The tid which is given in addba/delba req event is not
just tid but also muxed with the assoc id (MSB 4 bits)
which can be used to determine the corresponding connected
station in softap mode. The actual tid is LSB 4 bits. Using
the tid as it is with rx_tid[] would result in OOB or invalid
memory access in AP mode.
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/txrx.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/txrx.c b/drivers/net/wireless/ath/ath6kl/txrx.c index 8407d0103dcd..8cf7b2fa0f41 100644 --- a/drivers/net/wireless/ath/ath6kl/txrx.c +++ b/drivers/net/wireless/ath/ath6kl/txrx.c | |||
@@ -17,6 +17,17 @@ | |||
17 | #include "core.h" | 17 | #include "core.h" |
18 | #include "debug.h" | 18 | #include "debug.h" |
19 | 19 | ||
20 | /* | ||
21 | * tid - tid_mux0..tid_mux3 | ||
22 | * aid - tid_mux4..tid_mux7 | ||
23 | */ | ||
24 | #define ATH6KL_TID_MASK 0xf | ||
25 | |||
26 | static inline u8 ath6kl_get_tid(u8 tid_mux) | ||
27 | { | ||
28 | return tid_mux & ATH6KL_TID_MASK; | ||
29 | } | ||
30 | |||
20 | static u8 ath6kl_ibss_map_epid(struct sk_buff *skb, struct net_device *dev, | 31 | static u8 ath6kl_ibss_map_epid(struct sk_buff *skb, struct net_device *dev, |
21 | u32 *map_no) | 32 | u32 *map_no) |
22 | { | 33 | { |
@@ -1602,7 +1613,7 @@ static void aggr_delete_tid_state(struct aggr_info_conn *aggr_conn, u8 tid) | |||
1602 | memset(stats, 0, sizeof(struct rxtid_stats)); | 1613 | memset(stats, 0, sizeof(struct rxtid_stats)); |
1603 | } | 1614 | } |
1604 | 1615 | ||
1605 | void aggr_recv_addba_req_evt(struct ath6kl_vif *vif, u8 tid, u16 seq_no, | 1616 | void aggr_recv_addba_req_evt(struct ath6kl_vif *vif, u8 tid_mux, u16 seq_no, |
1606 | u8 win_sz) | 1617 | u8 win_sz) |
1607 | { | 1618 | { |
1608 | struct aggr_info *p_aggr = vif->aggr_cntxt; | 1619 | struct aggr_info *p_aggr = vif->aggr_cntxt; |
@@ -1610,12 +1621,17 @@ void aggr_recv_addba_req_evt(struct ath6kl_vif *vif, u8 tid, u16 seq_no, | |||
1610 | struct rxtid *rxtid; | 1621 | struct rxtid *rxtid; |
1611 | struct rxtid_stats *stats; | 1622 | struct rxtid_stats *stats; |
1612 | u16 hold_q_size; | 1623 | u16 hold_q_size; |
1624 | u8 tid; | ||
1613 | 1625 | ||
1614 | if (!p_aggr || !p_aggr->aggr_conn) | 1626 | if (!p_aggr || !p_aggr->aggr_conn) |
1615 | return; | 1627 | return; |
1616 | 1628 | ||
1617 | aggr_conn = p_aggr->aggr_conn; | 1629 | aggr_conn = p_aggr->aggr_conn; |
1618 | 1630 | ||
1631 | tid = ath6kl_get_tid(tid_mux); | ||
1632 | if (tid >= NUM_OF_TIDS) | ||
1633 | return; | ||
1634 | |||
1619 | rxtid = &aggr_conn->rx_tid[tid]; | 1635 | rxtid = &aggr_conn->rx_tid[tid]; |
1620 | stats = &aggr_conn->stat[tid]; | 1636 | stats = &aggr_conn->stat[tid]; |
1621 | 1637 | ||
@@ -1691,15 +1707,20 @@ struct aggr_info *aggr_init(struct ath6kl_vif *vif) | |||
1691 | return p_aggr; | 1707 | return p_aggr; |
1692 | } | 1708 | } |
1693 | 1709 | ||
1694 | void aggr_recv_delba_req_evt(struct ath6kl_vif *vif, u8 tid) | 1710 | void aggr_recv_delba_req_evt(struct ath6kl_vif *vif, u8 tid_mux) |
1695 | { | 1711 | { |
1696 | struct aggr_info *p_aggr = vif->aggr_cntxt; | 1712 | struct aggr_info *p_aggr = vif->aggr_cntxt; |
1697 | struct rxtid *rxtid; | 1713 | struct rxtid *rxtid; |
1698 | struct aggr_info_conn *aggr_conn; | 1714 | struct aggr_info_conn *aggr_conn; |
1715 | u8 tid; | ||
1699 | 1716 | ||
1700 | if (!p_aggr || !p_aggr->aggr_conn) | 1717 | if (!p_aggr || !p_aggr->aggr_conn) |
1701 | return; | 1718 | return; |
1702 | 1719 | ||
1720 | tid = ath6kl_get_tid(tid_mux); | ||
1721 | if (tid >= NUM_OF_TIDS) | ||
1722 | return; | ||
1723 | |||
1703 | aggr_conn = p_aggr->aggr_conn; | 1724 | aggr_conn = p_aggr->aggr_conn; |
1704 | rxtid = &aggr_conn->rx_tid[tid]; | 1725 | rxtid = &aggr_conn->rx_tid[tid]; |
1705 | 1726 | ||