diff options
author | Patrick McHardy <kaber@trash.net> | 2007-03-22 15:24:38 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-03-22 15:24:38 -0400 |
commit | ec25615b9ddd5c584b4066652840581fdb6c5e7a (patch) | |
tree | e84b4eff19ef3919232bb54d53b6e1ffd41d9cdc /net | |
parent | 961995582e3752e983dc3906a57546a188007440 (diff) |
[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 <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/fib_rules.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c index 215f1bff048f..3aea4e87d3d7 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) | |||
374 | return -EAFNOSUPPORT; | 374 | return -EAFNOSUPPORT; |
375 | 375 | ||
376 | rcu_read_lock(); | 376 | rcu_read_lock(); |
377 | list_for_each_entry(rule, ops->rules_list, list) { | 377 | list_for_each_entry_rcu(rule, ops->rules_list, list) { |
378 | if (idx < cb->args[0]) | 378 | if (idx < cb->args[0]) |
379 | goto skip; | 379 | goto skip; |
380 | 380 | ||