netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL nf-2.6] IPVS
@ 2011-06-13  8:47 Simon Horman
  2011-06-13  8:47 ` [PATCH] IPVS netns exit causes crash in conntrack Simon Horman
  2011-06-16 15:11 ` [GIT PULL nf-2.6] IPVS Patrick McHardy
  0 siblings, 2 replies; 4+ messages in thread
From: Simon Horman @ 2011-06-13  8:47 UTC (permalink / raw)
  To: lvs-devel, netdev, netfilter-devel, netfilter
  Cc: Wensong Zhang, Julian Anastasov, Patrick McHardy,
	Pablo Neira Ayuso

Hi Pablo,

please consider pulling
git://git.kernel.org/pub/scm/linux/kernel/git/horms/ipvs-2.6.git master
to get the following fix from Hans.

I believe this change should be considered for -stable.

Hans Schillstrom (1):
      IPVS netns exit causes crash in conntrack


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

* [PATCH] IPVS netns exit causes crash in conntrack
  2011-06-13  8:47 [GIT PULL nf-2.6] IPVS Simon Horman
@ 2011-06-13  8:47 ` Simon Horman
  2011-06-16 15:11 ` [GIT PULL nf-2.6] IPVS Patrick McHardy
  1 sibling, 0 replies; 4+ messages in thread
From: Simon Horman @ 2011-06-13  8:47 UTC (permalink / raw)
  To: lvs-devel, netdev, netfilter-devel, netfilter
  Cc: Wensong Zhang, Julian Anastasov, Patrick McHardy,
	Pablo Neira Ayuso, Hans Schillstrom, Simon Horman

From: Hans Schillstrom <hans.schillstrom@ericsson.com>

Quote from Patric Mc Hardy
"This looks like nfnetlink.c excited and destroyed the nfnl socket, but
ip_vs was still holding a reference to a conntrack. When the conntrack
got destroyed it created a ctnetlink event, causing an oops in
netlink_has_listeners when trying to use the destroyed nfnetlink
socket."

If nf_conntrack_netlink is loaded before ip_vs this is not a problem.

This patch simply avoids calling ip_vs_conn_drop_conntrack()
when netns is dying as suggested by Julian.

Signed-off-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 net/netfilter/ipvs/ip_vs_conn.c |   10 +++++++++-
 net/netfilter/ipvs/ip_vs_core.c |    1 +
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
index bf28ac2..782db27 100644
--- a/net/netfilter/ipvs/ip_vs_conn.c
+++ b/net/netfilter/ipvs/ip_vs_conn.c
@@ -776,8 +776,16 @@ static void ip_vs_conn_expire(unsigned long data)
 		if (cp->control)
 			ip_vs_control_del(cp);
 
-		if (cp->flags & IP_VS_CONN_F_NFCT)
+		if (cp->flags & IP_VS_CONN_F_NFCT) {
 			ip_vs_conn_drop_conntrack(cp);
+			/* Do not access conntracks during subsys cleanup
+			 * because nf_conntrack_find_get can not be used after
+			 * conntrack cleanup for the net.
+			 */
+			smp_rmb();
+			if (ipvs->enable)
+				ip_vs_conn_drop_conntrack(cp);
+		}
 
 		ip_vs_pe_put(cp->pe);
 		kfree(cp->pe_data);
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index 55af224..24c28d2 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -1945,6 +1945,7 @@ static void __net_exit __ip_vs_dev_cleanup(struct net *net)
 {
 	EnterFunction(2);
 	net_ipvs(net)->enable = 0;	/* Disable packet reception */
+	smp_wmb();
 	__ip_vs_sync_cleanup(net);
 	LeaveFunction(2);
 }
-- 
1.7.4.4


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

* Re: [GIT PULL nf-2.6] IPVS
  2011-06-13  8:47 [GIT PULL nf-2.6] IPVS Simon Horman
  2011-06-13  8:47 ` [PATCH] IPVS netns exit causes crash in conntrack Simon Horman
@ 2011-06-16 15:11 ` Patrick McHardy
  2011-06-16 22:06   ` Simon Horman
  1 sibling, 1 reply; 4+ messages in thread
From: Patrick McHardy @ 2011-06-16 15:11 UTC (permalink / raw)
  To: Simon Horman
  Cc: lvs-devel, netdev, netfilter-devel, netfilter, Wensong Zhang,
	Julian Anastasov, Pablo Neira Ayuso

On 13.06.2011 10:47, Simon Horman wrote:
> Hi Pablo,
> 
> please consider pulling
> git://git.kernel.org/pub/scm/linux/kernel/git/horms/ipvs-2.6.git master
> to get the following fix from Hans.
> 
> I believe this change should be considered for -stable.

Just send it to the stable people once it hits upstream. I'll
send it to Dave tonight.

> Hans Schillstrom (1):
>       IPVS netns exit causes crash in conntrac

Pulled, thanks Simon.


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

* Re: [GIT PULL nf-2.6] IPVS
  2011-06-16 15:11 ` [GIT PULL nf-2.6] IPVS Patrick McHardy
@ 2011-06-16 22:06   ` Simon Horman
  0 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2011-06-16 22:06 UTC (permalink / raw)
  To: Patrick McHardy
  Cc: lvs-devel, netdev, netfilter-devel, netfilter, Wensong Zhang,
	Julian Anastasov, Pablo Neira Ayuso

On Thu, Jun 16, 2011 at 05:11:10PM +0200, Patrick McHardy wrote:
> On 13.06.2011 10:47, Simon Horman wrote:
> > Hi Pablo,
> > 
> > please consider pulling
> > git://git.kernel.org/pub/scm/linux/kernel/git/horms/ipvs-2.6.git master
> > to get the following fix from Hans.
> > 
> > I believe this change should be considered for -stable.
> 
> Just send it to the stable people once it hits upstream. I'll
> send it to Dave tonight.

Understood, will do.

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

end of thread, other threads:[~2011-06-16 22:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-13  8:47 [GIT PULL nf-2.6] IPVS Simon Horman
2011-06-13  8:47 ` [PATCH] IPVS netns exit causes crash in conntrack Simon Horman
2011-06-16 15:11 ` [GIT PULL nf-2.6] IPVS Patrick McHardy
2011-06-16 22:06   ` Simon Horman

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