ipvs: uninitialized data with IP_VS_IPV6
Ben Hutchings
AppliedQuoted 9 lines · Pablo Neira Ayuso
From: Dan Carpenter <[email protected]>
[ upstream commit
3b05ac3824ed9648c0d9c02d51d9b54e4e7e874f]The
app_tcp_pkt_out()function expects "*diff" to be set and ends up using uninitialized data ifCONFIG_IP_VS_IPV6is turned on.The same issue is there in
app_tcp_pkt_in(). Thanks to Julian Anastasov for noticing that.
Queued up for 3.2, thanks.
Ben.
Quoted 55 lines
Cc <[email protected]> # 3.2.xCc <[email protected]> # 3.4.xCc <[email protected]> # 3.10.xCc <[email protected]> # 3.14.xCc <[email protected]> # 3.17.xCc <[email protected]> # 3.18.xSigned-off-by Dan Carpenter <[email protected]>Acked-by Julian Anastasov <[email protected]>Signed-off-by Simon Horman <[email protected]>--- net/netfilter/ipvs/ip_vs_ftp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)net/netfilter/ipvs/ip_vs_ftp.c +5
-5@@ -183,6 +183,8 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp,struct nf_conn *ct;struct net *net; + *diff =0 ; +#ifdef CONFIG_IP_VS_IPV6 /* This application helper doesn't work with IPv6 yet, * so turn this into a no-op for IPv6 packets @@ -191,8 +193,6 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp,return 1 ;#endif - *diff =0 ; -/* Only useful for established sessions */ if (cp->state !=IP_VS_TCP_S_ESTABLISHED )return 1 ;@@ -322,6 +322,9 @@ static int ip_vs_ftp_in(struct ip_vs_app *app, struct ip_vs_conn *cp,struct ip_vs_conn *n_cp;struct net *net; +/* no diff required for incoming packets */ + *diff =0 ; +#ifdef CONFIG_IP_VS_IPV6 /* This application helper doesn't work with IPv6 yet, * so turn this into a no-op for IPv6 packets @@ -330,9 +333,6 @@ static int ip_vs_ftp_in(struct ip_vs_app *app, struct ip_vs_conn *cp,return 1 ;#endif -/* no diff required for incoming packets */ - *diff =0 ; -/* Only useful for established sessions */ if (cp->state !=IP_VS_TCP_S_ESTABLISHED )return 1 ;
Signature · 2 lines
Ben Hutchings Once a job is fouled up, anything done to improve it makes it worse.