From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: [PATCH 4/9] netfilter: xtables: add scheduling opportunity in get_counters
Date: Fri, 8 Sep 2017 19:45:43 +0200 [thread overview]
Message-ID: <1504892748-1605-5-git-send-email-pablo@netfilter.org> (raw)
In-Reply-To: <1504892748-1605-1-git-send-email-pablo@netfilter.org>
From: Florian Westphal <fw@strlen.de>
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 <fw@strlen.de>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
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(+)
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c
index e04457198f93..9e2770fd00be 100644
--- a/net/ipv4/netfilter/arp_tables.c
+++ b/net/ipv4/netfilter/arp_tables.c
@@ -629,6 +629,7 @@ static void get_counters(const struct xt_table_info *t,
ADD_COUNTER(counters[i], bcnt, pcnt);
++i;
+ cond_resched();
}
}
}
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
index 576cba2b57e9..39286e543ee6 100644
--- a/net/ipv4/netfilter/ip_tables.c
+++ b/net/ipv4/netfilter/ip_tables.c
@@ -776,6 +776,7 @@ get_counters(const struct xt_table_info *t,
ADD_COUNTER(counters[i], bcnt, pcnt);
++i; /* macro does multi eval of i */
+ cond_resched();
}
}
}
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
index 54b1e75eded1..01bd3ee5ebc6 100644
--- a/net/ipv6/netfilter/ip6_tables.c
+++ b/net/ipv6/netfilter/ip6_tables.c
@@ -795,6 +795,7 @@ get_counters(const struct xt_table_info *t,
ADD_COUNTER(counters[i], bcnt, pcnt);
++i;
+ cond_resched();
}
}
}
--
2.1.4
next prev parent reply other threads:[~2017-09-08 17:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-08 17:45 [PATCH 0/9] Netfilter/IPVS fixes for net Pablo Neira Ayuso
2017-09-08 17:45 ` [PATCH 1/9] netfilter: ipvs: fix the issue that sctp_conn_schedule drops non-INIT packet Pablo Neira Ayuso
2017-09-08 17:45 ` [PATCH 2/9] netfilter: ipvs: do not create conn for ABORT packet in sctp_conn_schedule Pablo Neira Ayuso
2017-09-08 17:45 ` [PATCH 3/9] netfilter: nf_nat: don't bug when mapping already exists Pablo Neira Ayuso
2017-09-08 17:45 ` Pablo Neira Ayuso [this message]
2017-09-08 17:45 ` [PATCH 5/9] netfilter: nat: Revert "netfilter: nat: convert nat bysrc hash to rhashtable" Pablo Neira Ayuso
2017-09-08 17:45 ` [PATCH 6/9] netfilter: nat: use keyed locks Pablo Neira Ayuso
2017-09-08 17:45 ` [PATCH 7/9] netfilter: core: remove erroneous warn_on Pablo Neira Ayuso
2017-09-08 17:45 ` [PATCH 8/9] netfilter: xt_hashlimit: alloc hashtable with right size Pablo Neira Ayuso
2017-09-08 17:45 ` [PATCH 9/9] netfilter: xt_hashlimit: fix build error caused by 64bit division Pablo Neira Ayuso
2017-09-08 18:36 ` [PATCH 0/9] Netfilter/IPVS fixes for net David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1504892748-1605-5-git-send-email-pablo@netfilter.org \
--to=pablo@netfilter.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).