public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, Patrick McHardy <kaber@trash.net>,
	netfilter-devel@vger.kernel.org
Subject: ipvs 05/05: zero usvc and udest
Date: Tue, 15 Dec 2009 17:14:33 +0100 (MET)	[thread overview]
Message-ID: <20091215161432.4146.56195.sendpatchset@x2.localnet> (raw)
In-Reply-To: <20091215161426.4146.55284.sendpatchset@x2.localnet>

commit 258c889362aa95d0ab534b38ce8c15d3009705b1
Author: Simon Horman <horms@verge.net.au>
Date:   Tue Dec 15 17:01:25 2009 +0100

    ipvs: zero usvc and udest
    
    Make sure that any otherwise uninitialised fields of usvc are zero.
    
    This has been obvserved to cause a problem whereby the port of
    fwmark services may end up as a non-zero value which causes
    scheduling of a destination server to fail for persisitent services.
    
    As observed by Deon van der Merwe <dvdm@truteq.co.za>.
    This fix suggested by Julian Anastasov <ja@ssi.bg>.
    
    For good measure also zero udest.
    
    Cc: Deon van der Merwe <dvdm@truteq.co.za>
    Acked-by: Julian Anastasov <ja@ssi.bg>
    Signed-off-by: Simon Horman <horms@verge.net.au>
    Cc: stable@kernel.org
    Signed-off-by: Patrick McHardy <kaber@trash.net>

diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index e55a686..6bde12d 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -2714,6 +2714,8 @@ static int ip_vs_genl_parse_service(struct ip_vs_service_user_kern *usvc,
 	if (!(nla_af && (nla_fwmark || (nla_port && nla_protocol && nla_addr))))
 		return -EINVAL;
 
+	memset(usvc, 0, sizeof(*usvc));
+
 	usvc->af = nla_get_u16(nla_af);
 #ifdef CONFIG_IP_VS_IPV6
 	if (usvc->af != AF_INET && usvc->af != AF_INET6)
@@ -2901,6 +2903,8 @@ static int ip_vs_genl_parse_dest(struct ip_vs_dest_user_kern *udest,
 	if (!(nla_addr && nla_port))
 		return -EINVAL;
 
+	memset(udest, 0, sizeof(*udest));
+
 	nla_memcpy(&udest->addr, nla_addr, sizeof(udest->addr));
 	udest->port = nla_get_u16(nla_port);
 

  parent reply	other threads:[~2009-12-15 16:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-15 16:14 netfilter 00/05: netfilter fixes Patrick McHardy
2009-12-15 16:14 ` netfilter 01/05: xtables: document minimal required version Patrick McHardy
2009-12-15 16:14 ` ipvs 02/05: fix synchronization on connection close Patrick McHardy
2009-12-15 16:14 ` ipv6 03/05: reassembly: use seperate reassembly queues for conntrack and local delivery Patrick McHardy
2009-12-15 16:14 ` netfilter 04/05: fix crashes in bridge netfilter caused by fragment jumps Patrick McHardy
2009-12-15 16:14 ` Patrick McHardy [this message]
2009-12-16  5:12 ` netfilter 00/05: netfilter fixes David Miller

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=20091215161432.4146.56195.sendpatchset@x2.localnet \
    --to=kaber@trash.net \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --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