: Fix fib_rules dump race
Subsystems (3)
[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 <[email protected]>
net/core/fib_rules.c +1 -1
@@ -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;
* Patrick McHardy <[email protected]> 2007-03-22 15:38
Quoted 4 lines
[NET]: Fix
fib_rulesdump race
fib_rules_dumpneeds to uselist_for_each_entry_rcuto protect against concurrent changes to the rules list.
Good catch, it's not serialized with add/del by rtnl mutex if the dump gets interrupted.
Applied.