All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: stable@kernel.org
Cc: netfilter-devel@lists.netfilter.org,
	Patrick McHardy <kaber@trash.net>,
	davem@davemloft.net
Subject: [NETFILTER 04/13]: nfnetlink_log: fix reference leak
Date: Wed,  7 Mar 2007 22:34:32 +0100 (MET)	[thread overview]
Message-ID: <20070307213352.22306.5081.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20070307213347.22306.9248.sendpatchset@localhost.localdomain>

[NETFILTER]: nfnetlink_log: fix reference leak

Stop reference leaking in nfulnl_log_packet(). If we start a timer we
are already taking another reference.

Signed-off-by: Michal Miroslaw <mirq-linux@rere.qmqm.pl>
Signed-off-by: Patrick McHardy <kaber@trash.net>

---
commit 1a069cf250b123f7e407a0b59ff4803762d02a98
tree f9f71c51b1b9277c2d522f22ea14c6dbc2907d2b
parent 026cf98c00d9fd7a1cf241a29d466f04c84c4df1
author Michal Miroslaw <mirq-linux@rere.qmqm.pl> Tue, 06 Mar 2007 08:23:47 +0100
committer Patrick McHardy <kaber@trash.net> Tue, 06 Mar 2007 08:23:47 +0100

 net/netfilter/nfnetlink_log.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index d1505dd..8f85dc4 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -711,15 +711,16 @@ #endif
 		inst->timer.expires = jiffies + (inst->flushtimeout*HZ/100);
 		add_timer(&inst->timer);
 	}
-	spin_unlock_bh(&inst->lock);
 
+unlock_and_release:
+	spin_unlock_bh(&inst->lock);
+	instance_put(inst);
 	return;
 
 alloc_failure:
-	spin_unlock_bh(&inst->lock);
-	instance_put(inst);
 	UDEBUG("error allocating skb\n");
 	/* FIXME: statistics */
+	goto unlock_and_release;
 }
 
 static int

  parent reply	other threads:[~2007-03-07 21:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-07 21:34 [NETFILTER 00/13]: Netfilter -stable fixes Patrick McHardy
2007-03-07 21:34 ` [NETFILTER 01/13]: conntrack: fix {nf, ip}_ct_iterate_cleanup endless loops Patrick McHardy
2007-03-07 21:34 ` [NETFILTER 02/13]: nf_conntrack/nf_nat: fix incorrect config ifdefs Patrick McHardy
2007-03-07 21:34 ` [NETFILTER 03/13]: tcp conntrack: accept SYN|URG as valid Patrick McHardy
2007-03-07 21:34 ` Patrick McHardy [this message]
2007-03-07 21:34 ` [NETFILTER 05/13]: nfnetlink_log: fix use after free Patrick McHardy
2007-03-07 21:34 ` [NETFILTER 06/13]: nfnetlink_log: fix NULL pointer dereference Patrick McHardy
2007-03-07 21:34 ` [NETFILTER 07/13]: nfnetlink_log: fix possible " Patrick McHardy
2007-03-07 21:34 ` [NETFILTER 08/13]: nfnetlink_log: fix module reference counting Patrick McHardy
2007-03-07 21:34 ` [NETFILTER 09/13]: nfnetlink_log: fix " Patrick McHardy
2007-03-10  5:15   ` [stable] " Greg KH
2007-03-07 21:34 ` [NETFILTER 10/13]: ip6_route_me_harder should take into account mark Patrick McHardy
2007-03-07 21:34 ` [NETFILTER 11/13]: nf_conntrack: fix incorrect classification of IPv6 fragments as ESTABLISHED Patrick McHardy
2007-03-07 21:34 ` [NETFILTER 12/13]: nfnetlink_log: zero-terminate prefix Patrick McHardy
2007-03-07 21:34 ` [NETFILTER 13/13]: nfnetlink_log: fix crash on bridged packet Patrick McHardy

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=20070307213352.22306.5081.sendpatchset@localhost.localdomain \
    --to=kaber@trash.net \
    --cc=davem@davemloft.net \
    --cc=netfilter-devel@lists.netfilter.org \
    --cc=stable@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.