netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: Mauricio Faria de Oliveira <mfo@canonical.com>
Cc: stable@vger.kernel.org, netdev@vger.kernel.org,
	Florian Westphal <fw@strlen.de>,
	Alakesh Haloi <alakeshh@amazon.com>,
	nivedita.singhvi@canonical.com,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>,
	"David S. Miller" <davem@davemloft.net>,
	Yi-Hung Wei <yihung.wei@gmail.com>
Subject: Re: [PATCH v2 4.14 0/5] netfilter: xt_connlimit: backport upstream fixes for race in connection counting
Date: Sun, 6 Jan 2019 12:56:10 -0500	[thread overview]
Message-ID: <20190106175610.GE166797@sasha-vm> (raw)
In-Reply-To: <20190102204204.12389-1-mfo@canonical.com>

On Wed, Jan 02, 2019 at 06:41:59PM -0200, Mauricio Faria de Oliveira wrote:
>From: Ubuntu <ubuntu@petilil.segmaas.1ss>
>
>[changelog]
> - v2: include patch 5/5 (a very recent fix to patch 4/5) which is
>       not yet in Linus's tree but it's in nf.git + linux-next.git,
>       thus should make it shortly.  Test results still consistent.
>       Thanks Florian Westphal for reviewing and pointing that out.
>
>Recently, Alakesh Haloi reported the following issue [1] with stable/4.14:
>
>  """
>  An iptable rule like the following on a multicore systems will result in
>  accepting more connections than set in the rule.
>
>  iptables  -A INPUT -p tcp -m tcp --syn --dport 7777 -m connlimit \
>        --connlimit-above 2000 --connlimit-mask 0 -j DROP
>  """
>
>And proposed a fix that is not in Linus's tree. The discussion went on to
>confirm whether the issue was still reproducible with mainline/nf.git tip,
>and to either identify the upstream fix or re-submit the non-upstream fix.
>
>Alakesh eventually was able to test with upstream, and reported that issue
>was still reproducible [2].
>On that, our findinds diverge, at least in my test environment:
>
>First, I verified that the suggested mainline fix for the issue [3] indeed
>fixes it, by testing with it applied and reverted on v4.18, a clean revert.
>(The issue is reproducible with the commit reverted).
>
>Then, with a consistent reproducer, I moved to nf.git, with HEAD on commit
>a007232 ("netfilter: nf_conncount: fix argument order to find_next_bit"),
>and the issues was not reproducible (even with 20+ threads on client side,
>the number Alakesh reported to achieve 2150+ connections [4], and I tried
>spreading the network interface IRQ affinity over more and more CPUs too.)
>
>Either way, the suggested mainline fix does actually fix the issue in 4.14
>for at least one environment. So, it might well be the case that Alakesh's
>test environment has differences/subtleties that leads to more connections
>accepted, and more commits are needed for that particular environment type.
>
>(v2 update: see Florian's reply to v1 thread [1]; these different results
> are probably explained by very recent fixes still missing back then.)
>
>But for now, with one bare-metal environment (24-core server, 4-core client)
>verified, I thought of submitting the patches for review/comments/testing,
>then looking for additional fixes for that environment separately.
>
>The fix is PATCH 4 (needs fix in PATCH 5), and PATCHes 1-3 are helpers for
>a cleaner backport.
>All backports are simple, and essentially consist of refresh context lines
>and use older struct/file names.
>
>Reviews from netfilter maintainers are very appreciated, as I've no previous
>experience in this area, and although the backports look simple and build/run
>correctly, there's usually stuff that only more experienced people may notice.

Queued for 4.14, thank you.

      parent reply	other threads:[~2019-01-06 17:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-02 20:41 [PATCH v2 4.14 0/5] netfilter: xt_connlimit: backport upstream fixes for race in connection counting Mauricio Faria de Oliveira
2019-01-02 20:42 ` [PATCH v2 4.14 1/5] netfilter: xt_connlimit: don't store address in the conn nodes Mauricio Faria de Oliveira
2019-01-02 20:42 ` [PATCH v2 4.14 2/5] netfilter: nf_conncount: expose connection list interface Mauricio Faria de Oliveira
2019-01-02 20:42 ` [PATCH v2 4.14 3/5] netfilter: nf_conncount: Fix garbage collection with zones Mauricio Faria de Oliveira
2019-01-02 20:42 ` [PATCH v2 4.14 4/5] netfilter: nf_conncount: fix garbage collection confirm race Mauricio Faria de Oliveira
2019-01-02 20:42 ` [PATCH v2 4.14 5/5] netfilter: nf_conncount: don't skip eviction when age is negative Mauricio Faria de Oliveira
2019-01-06 17:56 ` Sasha Levin [this message]

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=20190106175610.GE166797@sasha-vm \
    --to=sashal@kernel.org \
    --cc=alakeshh@amazon.com \
    --cc=davem@davemloft.net \
    --cc=fw@strlen.de \
    --cc=kadlec@blackhole.kfki.hu \
    --cc=mfo@canonical.com \
    --cc=netdev@vger.kernel.org \
    --cc=nivedita.singhvi@canonical.com \
    --cc=pablo@netfilter.org \
    --cc=stable@vger.kernel.org \
    --cc=yihung.wei@gmail.com \
    /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).