netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: joe@ovn.org
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, pshelar@nicira.com
Subject: Re: [PATCH net] openvswitch: Fix template leak in error cases.
Date: Tue, 29 Dec 2015 15:28:22 -0500 (EST)	[thread overview]
Message-ID: <20151229.152822.353618428420139342.davem@davemloft.net> (raw)
In-Reply-To: <1450910367-61953-1-git-send-email-joe@ovn.org>

From: Joe Stringer <joe@ovn.org>
Date: Wed, 23 Dec 2015 14:39:27 -0800

> Commit 5b48bb8506c5 ("openvswitch: Fix helper reference leak") fixed a
> reference leak on helper objects, but inadvertently introduced a leak on
> the ct template.
> 
> Previously, ct_info.ct->general.use was initialized to 0 by
> nf_ct_tmpl_alloc() and only incremented when ovs_ct_copy_action()
> returned successful. If an error occurred while adding the helper or
> adding the action to the actions buffer, the __ovs_ct_free_action()
> cleanup would use nf_ct_put() to free the entry; However, this relies on
> atomic_dec_and_test(ct_info.ct->general.use). This reference must be
> incremented first, or nf_ct_put() will never free it.
> 
> Fix the issue by acquiring a reference to the template immediately after
> allocation.
> 
> Fixes: cae3a2627520 ("openvswitch: Allow attaching helpers to ct action")
> Fixes: 5b48bb8506c5 ("openvswitch: Fix helper reference leak")
> Signed-off-by: Joe Stringer <joe@ovn.org>

Looks good, applied, thanks Joe.

      reply	other threads:[~2015-12-29 20:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-23 22:39 [PATCH net] openvswitch: Fix template leak in error cases Joe Stringer
2015-12-29 20:28 ` David Miller [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=20151229.152822.353618428420139342.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=joe@ovn.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pshelar@nicira.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).