summaryrefslogtreecommitdiff
path: root/net/sched
diff options
context:
space:
mode:
authorJarek Poplawski <jarkao2@gmail.com>2009-01-20 14:08:23 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2009-01-24 16:36:19 -0800
commitc20cba0d08f3c6c10e0181077cca7f1833ffdb6b (patch)
tree657d8c37972be1c293bd0094f14d6668c93814ef /net/sched
parent82e1a122a1b01eef12fccecde30b7e7fbf4ece0e (diff)
pkt_sched: cls_u32: Fix locking in u32_change()
[ Upstream commit: 6f57321422e0d359e83c978c2b03db77b967b7d5 ] 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> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/cls_u32.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
index 246f9065ce34..ea51fcd2ac8e 100644
--- a/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -637,8 +637,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;