]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[PATCH] NETFILTER: Fix small information leak in SO_ORIGINAL_DST (CVE-2006-1343)
authorMarcel Holtmann <marcel@holtmann.org>
Fri, 26 May 2006 11:50:46 +0000 (13:50 +0200)
committerChris Wright <chrisw@sous-sol.org>
Wed, 31 May 2006 00:31:35 +0000 (17:31 -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: Chris Wright <chrisw@sous-sol.org>
net/ipv4/netfilter/ip_conntrack_core.c
net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c

index 84c66dbfedaf83505434124e6bf39621bc84ec96..43f6b453b2e79be167777004695e0963dbfe0840 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 6c8624a549334fc098d7987a60964a771dfb9b8f..62a0f52606146449edc6e42ec04cf8ec5c7a8ad7 100644 (file)
@@ -354,6 +354,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));