Commit 6f57321422e0d359e83c978c2b03db77b967b7d5

Authored by Jarek Poplawski
Committed by David S. Miller
1 parent f1d3e4dca3

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>

Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff

... ... @@ -638,8 +638,9 @@
638 638 break;
639 639  
640 640 n->next = *ins;
641   - wmb();
  641 + tcf_tree_lock(tp);
642 642 *ins = n;
  643 + tcf_tree_unlock(tp);
643 644  
644 645 *arg = (unsigned long)n;
645 646 return 0;