netfilter: xtables: add scheduling opportunity in get_counters
Subsystems (2)
Florian Westphal
maintainerPATCH 1/1 netfilter: xtables: add scheduling opportunity in get_counters
There are reports about spurious softlockups during iptables-restore, a backtrace i saw points at get_counters -- it uses a sequence lock and also has unbounded restart loop.
Signed-off-by Florian Westphal <[email protected]>
--- net/ipv4/netfilter/arp_tables.c | 1 + net/ipv4/netfilter/ip_tables.c | 1 + net/ipv6/netfilter/ip6_tables.c | 1 + 3 files changed, 3 insertions(+)
net/ipv4/netfilter/arp_tables.c +1 -0
@@ -629,6 +629,7 @@ static void get_counters(const struct xt_table_info *t,ADD_COUNTER (counters[i], bcnt, pcnt); ++i; +cond_resched (); } } }
net/ipv4/netfilter/ip_tables.c +1 -0
@@ -782,6 +782,7 @@ get_counters(const struct xt_table_info *t,ADD_COUNTER (counters[i], bcnt, pcnt); ++i;/* macro does multi eval of i */ +cond_resched (); } } }
net/ipv6/netfilter/ip6_tables.c +1 -0
@@ -801,6 +801,7 @@ get_counters(const struct xt_table_info *t,ADD_COUNTER (counters[i], bcnt, pcnt); ++i; +cond_resched (); } } }
Signature · 1 line
2.13.0
Quoted 10 lines · Florian Westphal
There are reports about spurious softlockups during iptables-restore, a backtrace i saw points at
get_counters-- it uses a sequence lock and also has unbounded restart loop.Signed-off-by Florian Westphal <[email protected]>--- net/ipv4/netfilter/arp_tables.c | 1 + net/ipv4/netfilter/ip_tables.c | 1 + net/ipv6/netfilter/ip6_tables.c | 1 + 3 files changed, 3 insertions(+)
SGTM, thanks Florian !
Acked-by Eric Dumazet <[email protected]>
Quoted 3 lines · Florian Westphal
There are reports about spurious softlockups during iptables-restore, a backtrace i saw points at
get_counters-- it uses a sequence lock and also has unbounded restart loop.
Applied, thanks.