Skip to content

Commit

Permalink
mac80211: Fix RCU pointer dereference in mesh_path_discard_frame()
Browse files Browse the repository at this point in the history
Reported by Pedro Larbig (ASPj)

Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Javier Cardona authored and John W. Linville committed Sep 13, 2011
1 parent 5982b47 commit af089c1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion net/mac80211/mesh_pathtbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -991,9 +991,14 @@ void mesh_path_discard_frame(struct sk_buff *skb,

da = hdr->addr3;
ra = hdr->addr1;
rcu_read_lock();
mpath = mesh_path_lookup(da, sdata);
if (mpath)
if (mpath) {
spin_lock_bh(&mpath->state_lock);
sn = ++mpath->sn;
spin_unlock_bh(&mpath->state_lock);
}
rcu_read_unlock();
mesh_path_error_tx(sdata->u.mesh.mshcfg.element_ttl, skb->data,
cpu_to_le32(sn), reason, ra, sdata);
}
Expand Down

0 comments on commit af089c1

Please sign in to comment.