LVS
lvs-devel
Google
 
Web LinuxVirtualServer.org

Re: [PATCH] netfilter, ipvs: Avoid undefined order of evaluation in assi

To: Jesper Juhl <jj@xxxxxxxxxxxxx>
Subject: Re: [PATCH] netfilter, ipvs: Avoid undefined order of evaluation in assignments to struct nf_conn *
Cc: linux-kernel@xxxxxxxxxxxxxxx, netfilter@xxxxxxxxxxxxxxx, coreteam@xxxxxxxxxxxxx, netfilter-devel@xxxxxxxxxxxxxxx, lvs-devel@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, "David S. Miller" <davem@xxxxxxxxxxxxx>, Patrick McHardy <kaber@xxxxxxxxx>, Julian Anastasov <ja@xxxxxx>, Wensong Zhang <wensong@xxxxxxxxxxxx>, Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
From: Simon Horman <horms@xxxxxxxxxxxx>
Date: Mon, 30 May 2011 08:23:37 +0900
On Sun, May 29, 2011 at 08:22:56PM +0200, Jesper Juhl wrote:
> In net/netfilter/ipvs/ip_vs_nfct.c::ip_vs_update_conntrack(),
> net/netfilter/ipvs/ip_vs_xmit.c::ip_vs_nat_xmit(), 
> net/netfilter/ipvs/ip_vs_xmit.c::ip_vs_nat_xmit_v6(), 
> net/netfilter/ipvs/ip_vs_xmit.c::ip_vs_icmp_xmit)() 
> net/netfilter/ipvs/ip_vs_xmit.c::and ip_vs_icmp_xmit_v6() we do this:
>       ...
>       struct nf_conn *ct = ct = nf_ct_get(skb, &ctinfo);
>       ...
> 
> Since '=' is not a sequence point the order of these assignments happening 
> is undefined. Luckily it's easy to avoid by just doing what is obviously 
> the intended thing:
>       struct nf_conn *ct = nf_ct_get(skb, &ctinfo);
> 
> Signed-off-by: Jesper Juhl <jj@xxxxxxxxxxxxx>

Acked-by: Simon Horman <horms@xxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe lvs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

<Prev in Thread] Current Thread [Next in Thread>