Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec25615b authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller
Browse files

[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: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 96199558
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;