netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Daniel Borkmann <daniel@iogearbox.net>
Cc: bjackson0971@gmail.com, fw@strlen.de, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf] netfilter: conntrack: use nf_ct_tmpl_free in CT/synproxy error paths
Date: Tue, 1 Sep 2015 12:40:03 +0200	[thread overview]
Message-ID: <20150901104003.GA8107@salvia> (raw)
In-Reply-To: <9caca1293214eeacb76490fa79aa4c4364920139.1441039959.git.daniel@iogearbox.net>

On Mon, Aug 31, 2015 at 07:11:02PM +0200, Daniel Borkmann wrote:
> Commit 0838aa7fcfcd ("netfilter: fix netns dependencies with conntrack
> templates") migrated templates to the new allocator api, but forgot to
> update error paths for them in CT and synproxy to use nf_ct_tmpl_free()
> instead of nf_conntrack_free().
> 
> Due to that, memory is being freed into the wrong kmemcache, but also
> we drop the per net reference count of ct objects causing an imbalance.
> 
> In Brad's case, this leads to a wrap-around of net->ct.count and thus
> lets __nf_conntrack_alloc() refuse to create a new ct object:
> 
>   [   10.340913] xt_addrtype: ipv6 does not support BROADCAST matching
>   [   10.810168] nf_conntrack: table full, dropping packet
>   [   11.917416] r8169 0000:07:00.0 eth0: link up
>   [   11.917438] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
>   [   12.815902] nf_conntrack: table full, dropping packet
>   [   15.688561] nf_conntrack: table full, dropping packet
>   [   15.689365] nf_conntrack: table full, dropping packet
>   [   15.690169] nf_conntrack: table full, dropping packet
>   [   15.690967] nf_conntrack: table full, dropping packet
>   [...]
> 
> With slab debugging, it also reports the wrong kmemcache (kmalloc-512 vs.
> nf_conntrack_ffffffff81ce75c0) and reports poison overwrites, etc. Thus,
> to fix the problem, export and use nf_ct_tmpl_free() instead.

Applied, thanks Daniel.

      reply	other threads:[~2015-09-01 10:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-31 17:11 [PATCH nf] netfilter: conntrack: use nf_ct_tmpl_free in CT/synproxy error paths Daniel Borkmann
2015-09-01 10:40 ` Pablo Neira Ayuso [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=20150901104003.GA8107@salvia \
    --to=pablo@netfilter.org \
    --cc=bjackson0971@gmail.com \
    --cc=daniel@iogearbox.net \
    --cc=fw@strlen.de \
    --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).