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>
This commit is contained in:
committed by
John W. Linville
parent
9b84b80891
commit
28104cae63
@@ -1751,6 +1751,7 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
|
|||||||
ret = NETDEV_TX_OK;
|
ret = NETDEV_TX_OK;
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
rcu_read_lock();
|
||||||
if (!is_multicast_ether_addr(skb->data))
|
if (!is_multicast_ether_addr(skb->data))
|
||||||
mppath = mpp_path_lookup(skb->data, sdata);
|
mppath = mpp_path_lookup(skb->data, sdata);
|
||||||
|
|
||||||
@@ -1765,13 +1766,13 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
|
|||||||
!(mppath && compare_ether_addr(mppath->mpp, skb->data))) {
|
!(mppath && compare_ether_addr(mppath->mpp, skb->data))) {
|
||||||
hdrlen = ieee80211_fill_mesh_addresses(&hdr, &fc,
|
hdrlen = ieee80211_fill_mesh_addresses(&hdr, &fc,
|
||||||
skb->data, skb->data + ETH_ALEN);
|
skb->data, skb->data + ETH_ALEN);
|
||||||
|
rcu_read_unlock();
|
||||||
meshhdrlen = ieee80211_new_mesh_header(&mesh_hdr,
|
meshhdrlen = ieee80211_new_mesh_header(&mesh_hdr,
|
||||||
sdata, NULL, NULL);
|
sdata, NULL, NULL);
|
||||||
} else {
|
} else {
|
||||||
int is_mesh_mcast = 1;
|
int is_mesh_mcast = 1;
|
||||||
const u8 *mesh_da;
|
const u8 *mesh_da;
|
||||||
|
|
||||||
rcu_read_lock();
|
|
||||||
if (is_multicast_ether_addr(skb->data))
|
if (is_multicast_ether_addr(skb->data))
|
||||||
/* DA TA mSA AE:SA */
|
/* DA TA mSA AE:SA */
|
||||||
mesh_da = skb->data;
|
mesh_da = skb->data;
|
||||||
|
Reference in New Issue
Block a user