ipvs: zero usvc and udest
Subsystems (4)
Simon Horman
maintainerPATCH 1/1 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 <[email protected]>. This fix suggested by Julian Anastasov <[email protected]>.
For good measure also zero udest.
---
This bug has been present since the netlink interface to IPVS was introduced in 2.6.28. I think it is relevant for 2.6.33 as well as -stable.
net/netfilter/ipvs/ip_vs_ctl.c +4 -0
@@ -2714,6 +2714,8 @@ static int ip_vs_genl_parse_service(struif (!(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(structif (!(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);
Patrick McHardy
AppliedQuoted 15 lines · Simon Horman
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 <[email protected]>. This fix suggested by Julian Anastasov <[email protected]>.
For good measure also zero udest.
Cc Deon van der Merwe <[email protected]>Acked-by Julian Anastasov <[email protected]>Signed-off-by Simon Horman <[email protected]>
Quoted 5 lines
---
This bug has been present since the netlink interface to IPVS was introduced in 2.6.28. I think it is relevant for 2.6.33 as well as -stable.
Applied, thanks. I'll push it to -stable as well.