From: Patrick McHardy Date: Thu, 22 Mar 2007 19:24:38 +0000 (-0700) Subject: [NET]: Fix fib_rules dump race X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ec25615b9ddd5c584b4066652840581fdb6c5e7a;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git [NET]: Fix fib_rules dump race fib_rules_dump needs to use list_for_each_entry_rcu to protect against concurrent changes to the rules list. Signed-off-by: Patrick McHardy Signed-off-by: David S. Miller --- diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c index 215f1bff048..3aea4e87d3d 100644 --- a/net/core/fib_rules.c +++ b/net/core/fib_rules.c @@ -374,7 +374,7 @@ int fib_rules_dump(struct sk_buff *skb, struct netlink_callback *cb, int family) return -EAFNOSUPPORT; rcu_read_lock(); - list_for_each_entry(rule, ops->rules_list, list) { + list_for_each_entry_rcu(rule, ops->rules_list, list) { if (idx < cb->args[0]) goto skip;