]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.10.67/ipvs-uninitialized-data-with-ip_vs_ipv6.patch
Linux 4.14.95
[thirdparty/kernel/stable-queue.git] / releases / 3.10.67 / ipvs-uninitialized-data-with-ip_vs_ipv6.patch
1 From 3b05ac3824ed9648c0d9c02d51d9b54e4e7e874f Mon Sep 17 00:00:00 2001
2 From: Dan Carpenter <dan.carpenter@oracle.com>
3 Date: Sat, 6 Dec 2014 16:49:24 +0300
4 Subject: ipvs: uninitialized data with IP_VS_IPV6
5
6 From: Dan Carpenter <dan.carpenter@oracle.com>
7
8 commit 3b05ac3824ed9648c0d9c02d51d9b54e4e7e874f upstream.
9
10 The app_tcp_pkt_out() function expects "*diff" to be set and ends up
11 using uninitialized data if CONFIG_IP_VS_IPV6 is turned on.
12
13 The same issue is there in app_tcp_pkt_in(). Thanks to Julian Anastasov
14 for noticing that.
15
16 Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
17 Acked-by: Julian Anastasov <ja@ssi.bg>
18 Signed-off-by: Simon Horman <horms@verge.net.au>
19 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20
21 ---
22 net/netfilter/ipvs/ip_vs_ftp.c | 10 +++++-----
23 1 file changed, 5 insertions(+), 5 deletions(-)
24
25 --- a/net/netfilter/ipvs/ip_vs_ftp.c
26 +++ b/net/netfilter/ipvs/ip_vs_ftp.c
27 @@ -183,6 +183,8 @@ static int ip_vs_ftp_out(struct ip_vs_ap
28 struct nf_conn *ct;
29 struct net *net;
30
31 + *diff = 0;
32 +
33 #ifdef CONFIG_IP_VS_IPV6
34 /* This application helper doesn't work with IPv6 yet,
35 * so turn this into a no-op for IPv6 packets
36 @@ -191,8 +193,6 @@ static int ip_vs_ftp_out(struct ip_vs_ap
37 return 1;
38 #endif
39
40 - *diff = 0;
41 -
42 /* Only useful for established sessions */
43 if (cp->state != IP_VS_TCP_S_ESTABLISHED)
44 return 1;
45 @@ -321,6 +321,9 @@ static int ip_vs_ftp_in(struct ip_vs_app
46 struct ip_vs_conn *n_cp;
47 struct net *net;
48
49 + /* no diff required for incoming packets */
50 + *diff = 0;
51 +
52 #ifdef CONFIG_IP_VS_IPV6
53 /* This application helper doesn't work with IPv6 yet,
54 * so turn this into a no-op for IPv6 packets
55 @@ -329,9 +332,6 @@ static int ip_vs_ftp_in(struct ip_vs_app
56 return 1;
57 #endif
58
59 - /* no diff required for incoming packets */
60 - *diff = 0;
61 -
62 /* Only useful for established sessions */
63 if (cp->state != IP_VS_TCP_S_ESTABLISHED)
64 return 1;