[NETFILTER]: Fix small information leak in SO_ORIGINAL_DST (CVE-2006-1343)
authorMarcel Holtmann <marcel@holtmann.org>
Mon, 29 May 2006 05:50:18 +0000 (22:50 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 29 May 2006 05:50:18 +0000 (22:50 -0700)
It appears that sockaddr_in.sin_zero is not zeroed during
getsockopt(...SO_ORIGINAL_DST...) operation. This can lead
to an information leak (CVE-2006-1343).

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/netfilter/ip_conntrack_core.c
net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c

index 979a2eac6f003101438ecd518b1c4d9c2c365bf8..a297da7bbef5dc735d1c68d57fe35b1db901d820 100644 (file)
@@ -1318,6 +1318,7 @@ getorigdst(struct sock *sk, int optval, void __user *user, int *len)
                        .tuple.dst.u.tcp.port;
                sin.sin_addr.s_addr = ct->tuplehash[IP_CT_DIR_ORIGINAL]
                        .tuple.dst.ip;
+               memset(sin.sin_zero, 0, sizeof(sin.sin_zero));
 
                DEBUGP("SO_ORIGINAL_DST: %u.%u.%u.%u %u\n",
                       NIPQUAD(sin.sin_addr.s_addr), ntohs(sin.sin_port));
index 5bc9f64d7b5b06f9bf1d5a2d8c3923f6fdaccfb9..77d974443c7b6291e54ca4713945a0a53d582167 100644 (file)
@@ -348,6 +348,7 @@ getorigdst(struct sock *sk, int optval, void __user *user, int *len)
                        .tuple.dst.u.tcp.port;
                sin.sin_addr.s_addr = ct->tuplehash[IP_CT_DIR_ORIGINAL]
                        .tuple.dst.u3.ip;
+               memset(sin.sin_zero, 0, sizeof(sin.sin_zero));
 
                DEBUGP("SO_ORIGINAL_DST: %u.%u.%u.%u %u\n",
                       NIPQUAD(sin.sin_addr.s_addr), ntohs(sin.sin_port));