Skip to content

Commit

Permalink
[NET]: Fix fib_rules dump race
Browse files Browse the repository at this point in the history
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 <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Mar 22, 2007
1 parent 9619955 commit ec25615
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/core/fib_rules.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit ec25615

Please sign in to comment.