Signed-off-by: Cong Wang <[email protected]>
---
net/sched/act_api.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 2f8db3c..fb6ff52 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -470,10 +470,14 @@ int tcf_action_exec(struct sk_buff *skb, struct tc_action
**actions,
goto exec_done;
}
for (i = 0; i < nr_actions; i++) {
- const struct tc_action *a = actions[i];
+ const struct tc_action *a;
+ rcu_read_lock();
+ a = rcu_dereference(actions[i]);
repeat:
ret = a->ops->act(skb, a, res);
+ rcu_read_unlock();
+
if (ret == TC_ACT_REPEAT)
goto repeat; /* we need a ttl - JHS */
if (ret != TC_ACT_PIPE)
--
2.1.0