diff options
author | Javier Cardona <javier@cozybit.com> | 2011-05-03 19:57:17 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-05-11 14:50:35 -0400 |
commit | 28104cae63708d1790cd71db8a45af50d5ea5a92 (patch) | |
tree | 035b490c6db1cf1f17e38adf66aab103540ff735 /net/mac80211/tx.c | |
parent | 9b84b80891e5e25ae21c855bb135b05274125a29 (diff) |
mac80211: Move call to mpp_path_lookup inside RCU-read section
PROVE_RCU caught that one:
[ 431.214070] ===================================================
[ 431.215341] [ INFO: suspicious rcu_dereference_check() usage. ]
[ 431.215674] ---------------------------------------------------
[ 431.216043] net/mac80211/mesh_pathtbl.c:184 invoked
rcu_dereference_check() without protection!
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/tx.c')
-rw-r--r-- | net/mac80211/tx.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index e1a39ed1ef5e..c9f12113ca6a 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -1751,6 +1751,7 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
1751 | ret = NETDEV_TX_OK; | 1751 | ret = NETDEV_TX_OK; |
1752 | goto fail; | 1752 | goto fail; |
1753 | } | 1753 | } |
1754 | rcu_read_lock(); | ||
1754 | if (!is_multicast_ether_addr(skb->data)) | 1755 | if (!is_multicast_ether_addr(skb->data)) |
1755 | mppath = mpp_path_lookup(skb->data, sdata); | 1756 | mppath = mpp_path_lookup(skb->data, sdata); |
1756 | 1757 | ||
@@ -1765,13 +1766,13 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
1765 | !(mppath && compare_ether_addr(mppath->mpp, skb->data))) { | 1766 | !(mppath && compare_ether_addr(mppath->mpp, skb->data))) { |
1766 | hdrlen = ieee80211_fill_mesh_addresses(&hdr, &fc, | 1767 | hdrlen = ieee80211_fill_mesh_addresses(&hdr, &fc, |
1767 | skb->data, skb->data + ETH_ALEN); | 1768 | skb->data, skb->data + ETH_ALEN); |
1769 | rcu_read_unlock(); | ||
1768 | meshhdrlen = ieee80211_new_mesh_header(&mesh_hdr, | 1770 | meshhdrlen = ieee80211_new_mesh_header(&mesh_hdr, |
1769 | sdata, NULL, NULL); | 1771 | sdata, NULL, NULL); |
1770 | } else { | 1772 | } else { |
1771 | int is_mesh_mcast = 1; | 1773 | int is_mesh_mcast = 1; |
1772 | const u8 *mesh_da; | 1774 | const u8 *mesh_da; |
1773 | 1775 | ||
1774 | rcu_read_lock(); | ||
1775 | if (is_multicast_ether_addr(skb->data)) | 1776 | if (is_multicast_ether_addr(skb->data)) |
1776 | /* DA TA mSA AE:SA */ | 1777 | /* DA TA mSA AE:SA */ |
1777 | mesh_da = skb->data; | 1778 | mesh_da = skb->data; |