netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 21/30] netfilter: bridge: refcount fix
       [not found] ` <20091001233504.GA17709@kroah.com>
@ 2009-10-01 23:31   ` Greg KH
  2009-10-01 23:31   ` [patch 22/30] netfilter: ebt_ulog: fix checkentry return value Greg KH
  2009-10-01 23:31   ` [patch 23/30] netfilter: nf_nat: fix inverted logic for persistent NAT mappings Greg KH
  2 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2009-10-01 23:31 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, netdev, netfilter-devel,
	Patrick McHardy, davem, Eric Dumazet

[-- Attachment #1: netfilter-bridge-refcount-fix.patch --]
[-- Type: text/plain, Size: 1097 bytes --]


2.6.30-stable review patch.  If anyone has any objections, please let us know.

------------------
From: Patrick McHardy <kaber@trash.net>

netfilter: bridge: refcount fix

Upstream commit f3abc9b9:

commit f216f082b2b37c4943f1e7c393e2786648d48f6f
([NETFILTER]: bridge netfilter: deal with martians correctly)
added a refcount leak on in_dev.

Instead of using in_dev_get(), we can use __in_dev_get_rcu(),
as netfilter hooks are running under rcu_read_lock(), as pointed
by Patrick.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/bridge/br_netfilter.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -357,7 +357,7 @@ static int br_nf_pre_routing_finish(stru
 				},
 				.proto = 0,
 			};
-			struct in_device *in_dev = in_dev_get(dev);
+			struct in_device *in_dev = __in_dev_get_rcu(dev);
 
 			/* If err equals -EHOSTUNREACH the error is due to a
 			 * martian destination or due to the fact that

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [patch 22/30] netfilter: ebt_ulog: fix checkentry return value
       [not found] ` <20091001233504.GA17709@kroah.com>
  2009-10-01 23:31   ` [patch 21/30] netfilter: bridge: refcount fix Greg KH
@ 2009-10-01 23:31   ` Greg KH
  2009-10-01 23:31   ` [patch 23/30] netfilter: nf_nat: fix inverted logic for persistent NAT mappings Greg KH
  2 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2009-10-01 23:31 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, netdev, netfilter-devel,
	Patrick McHardy, davem

[-- Attachment #1: netfilter-ebt_ulog-fix-checkentry-return-value.patch --]
[-- Type: text/plain, Size: 900 bytes --]


2.6.30-stable review patch.  If anyone has any objections, please let us know.

------------------
From: Patrick McHardy <kaber@trash.net>

netfilter: ebt_ulog: fix checkentry return value

Upstream commit 8a56df0a:

Commit 19eda87 (netfilter: change return types of check functions for
Ebtables extensions) broke the ebtables ulog module by missing a return
value conversion.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/bridge/netfilter/ebt_ulog.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/bridge/netfilter/ebt_ulog.c
+++ b/net/bridge/netfilter/ebt_ulog.c
@@ -266,7 +266,7 @@ static bool ebt_ulog_tg_check(const stru
 	if (uloginfo->qthreshold > EBT_ULOG_MAX_QLEN)
 		uloginfo->qthreshold = EBT_ULOG_MAX_QLEN;
 
-	return 0;
+	return true;
 }
 
 static struct xt_target ebt_ulog_tg_reg __read_mostly = {



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [patch 23/30] netfilter: nf_nat: fix inverted logic for persistent NAT mappings
       [not found] ` <20091001233504.GA17709@kroah.com>
  2009-10-01 23:31   ` [patch 21/30] netfilter: bridge: refcount fix Greg KH
  2009-10-01 23:31   ` [patch 22/30] netfilter: ebt_ulog: fix checkentry return value Greg KH
@ 2009-10-01 23:31   ` Greg KH
  2 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2009-10-01 23:31 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, netdev, netfilter-devel,
	Patrick McHardy, davem, Maximilian Engelhardt

[-- Attachment #1: netfilter-nf_nat-fix-inverted-logic-for-persistent-nat-mappings.patch --]
[-- Type: text/plain, Size: 1554 bytes --]


2.6.30-stable review patch.  If anyone has any objections, please let us know.

------------------
From: Patrick McHardy <kaber@trash.net>

netfilter: nf_nat: fix inverted logic for persistent NAT mappings

Upstream commit cce5a5c3:

Kernel 2.6.30 introduced a patch [1] for the persistent option in the
netfilter SNAT target. This is exactly what we need here so I had a quick look
at the code and noticed that the patch is wrong. The logic is simply inverted.
The patch below fixes this.

Also note that because of this the default behavior of the SNAT target has
changed since kernel 2.6.30 as it now ignores the destination IP in choosing
the source IP for nating (which should only be the case if the persistent
option is set).

[1] http://git.eu.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=98d500d66cb7940747b424b245fc6a51ecfbf005

Signed-off-by: Maximilian Engelhardt <maxi@daemonizer.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/ipv4/netfilter/nf_nat_core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/ipv4/netfilter/nf_nat_core.c
+++ b/net/ipv4/netfilter/nf_nat_core.c
@@ -212,7 +212,7 @@ find_best_ips_proto(struct nf_conntrack_
 	maxip = ntohl(range->max_ip);
 	j = jhash_2words((__force u32)tuple->src.u3.ip,
 			 range->flags & IP_NAT_RANGE_PERSISTENT ?
-				(__force u32)tuple->dst.u3.ip : 0, 0);
+				0 : (__force u32)tuple->dst.u3.ip, 0);
 	j = ((u64)j * (maxip - minip + 1)) >> 32;
 	*var_ipp = htonl(minip + j);
 }



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-10-01 23:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20091001233116.947658905@mini.kroah.org>
     [not found] ` <20091001233504.GA17709@kroah.com>
2009-10-01 23:31   ` [patch 21/30] netfilter: bridge: refcount fix Greg KH
2009-10-01 23:31   ` [patch 22/30] netfilter: ebt_ulog: fix checkentry return value Greg KH
2009-10-01 23:31   ` [patch 23/30] netfilter: nf_nat: fix inverted logic for persistent NAT mappings Greg KH

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).