* [NET]: Fix fib_rules dump race
@ 2007-03-22 14:38 Patrick McHardy
2007-03-22 19:17 ` Thomas Graf
2007-03-22 19:25 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Patrick McHardy @ 2007-03-22 14:38 UTC (permalink / raw)
To: David S. Miller; +Cc: Kernel Netdev Mailing List, Thomas Graf
[-- Attachment #1: Type: text/plain, Size: 0 bytes --]
[-- Attachment #2: x --]
[-- Type: text/plain, Size: 632 bytes --]
[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>
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index 215f1bf..3aea4e8 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;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [NET]: Fix fib_rules dump race
2007-03-22 14:38 [NET]: Fix fib_rules dump race Patrick McHardy
@ 2007-03-22 19:17 ` Thomas Graf
2007-03-22 19:25 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Graf @ 2007-03-22 19:17 UTC (permalink / raw)
To: Patrick McHardy; +Cc: David S. Miller, Kernel Netdev Mailing List
* Patrick McHardy <kaber@trash.net> 2007-03-22 15:38
> [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.
Good catch, it's not serialized with add/del by rtnl mutex if the
dump gets interrupted.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [NET]: Fix fib_rules dump race
2007-03-22 14:38 [NET]: Fix fib_rules dump race Patrick McHardy
2007-03-22 19:17 ` Thomas Graf
@ 2007-03-22 19:25 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2007-03-22 19:25 UTC (permalink / raw)
To: kaber; +Cc: netdev, tgraf
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-03-22 19:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-22 14:38 [NET]: Fix fib_rules dump race Patrick McHardy
2007-03-22 19:17 ` Thomas Graf
2007-03-22 19:25 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).