diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2014-12-06 08:49:24 -0500 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2014-12-10 03:36:47 -0500 |
commit | 3b05ac3824ed9648c0d9c02d51d9b54e4e7e874f (patch) | |
tree | e6c33517e937534907789feacbf60e9c0bc6bb3e /net | |
parent | d6b00fec5dbbe976904b4d77e7d4f9493df5c2ec (diff) |
ipvs: uninitialized data with IP_VS_IPV6
The app_tcp_pkt_out() function expects "*diff" to be set and ends up
using uninitialized data if CONFIG_IP_VS_IPV6 is turned on.
The same issue is there in app_tcp_pkt_in(). Thanks to Julian Anastasov
for noticing that.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'net')
-rw-r--r-- | net/netfilter/ipvs/ip_vs_ftp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/netfilter/ipvs/ip_vs_ftp.c b/net/netfilter/ipvs/ip_vs_ftp.c index 1d5341f3761d..5d3daae98bf0 100644 --- a/net/netfilter/ipvs/ip_vs_ftp.c +++ b/net/netfilter/ipvs/ip_vs_ftp.c | |||
@@ -183,6 +183,8 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp, | |||
183 | struct nf_conn *ct; | 183 | struct nf_conn *ct; |
184 | struct net *net; | 184 | struct net *net; |
185 | 185 | ||
186 | *diff = 0; | ||
187 | |||
186 | #ifdef CONFIG_IP_VS_IPV6 | 188 | #ifdef CONFIG_IP_VS_IPV6 |
187 | /* This application helper doesn't work with IPv6 yet, | 189 | /* This application helper doesn't work with IPv6 yet, |
188 | * so turn this into a no-op for IPv6 packets | 190 | * 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, | |||
191 | return 1; | 193 | return 1; |
192 | #endif | 194 | #endif |
193 | 195 | ||
194 | *diff = 0; | ||
195 | |||
196 | /* Only useful for established sessions */ | 196 | /* Only useful for established sessions */ |
197 | if (cp->state != IP_VS_TCP_S_ESTABLISHED) | 197 | if (cp->state != IP_VS_TCP_S_ESTABLISHED) |
198 | return 1; | 198 | return 1; |
@@ -322,6 +322,9 @@ static int ip_vs_ftp_in(struct ip_vs_app *app, struct ip_vs_conn *cp, | |||
322 | struct ip_vs_conn *n_cp; | 322 | struct ip_vs_conn *n_cp; |
323 | struct net *net; | 323 | struct net *net; |
324 | 324 | ||
325 | /* no diff required for incoming packets */ | ||
326 | *diff = 0; | ||
327 | |||
325 | #ifdef CONFIG_IP_VS_IPV6 | 328 | #ifdef CONFIG_IP_VS_IPV6 |
326 | /* This application helper doesn't work with IPv6 yet, | 329 | /* This application helper doesn't work with IPv6 yet, |
327 | * so turn this into a no-op for IPv6 packets | 330 | * 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, | |||
330 | return 1; | 333 | return 1; |
331 | #endif | 334 | #endif |
332 | 335 | ||
333 | /* no diff required for incoming packets */ | ||
334 | *diff = 0; | ||
335 | |||
336 | /* Only useful for established sessions */ | 336 | /* Only useful for established sessions */ |
337 | if (cp->state != IP_VS_TCP_S_ESTABLISHED) | 337 | if (cp->state != IP_VS_TCP_S_ESTABLISHED) |
338 | return 1; | 338 | return 1; |