Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6f573214 authored by Jarek Poplawski's avatar Jarek Poplawski Committed by David S. Miller
Browse files

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: default avatarm0sia <m0sia@plotinka.ru>
Signed-off-by: default avatarJarek Poplawski <jarkao2@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f1d3e4dc
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;