mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 11:16:11 +00:00
pkt_sched: cls_u32: Fix locking in u32_change()
New nodes are inserted in u32_change() under rtnl_lock() with wmb(), so without tcf_tree_lock() like in other classifiers (e.g. cls_fw). This isn't enough without rmb() on the read side, but on the other hand adding such barriers doesn't give any savings, so the lock is added instead. Reported-by: m0sia <m0sia@plotinka.ru> Signed-off-by: Jarek Poplawski <jarkao2@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
f1d3e4dca3
commit
6f57321422
1 changed files with 2 additions and 1 deletions
|
@ -638,8 +638,9 @@ static int u32_change(struct tcf_proto *tp, unsigned long base, u32 handle,
|
|||
break;
|
||||
|
||||
n->next = *ins;
|
||||
wmb();
|
||||
tcf_tree_lock(tp);
|
||||
*ins = n;
|
||||
tcf_tree_unlock(tp);
|
||||
|
||||
*arg = (unsigned long)n;
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue