]> git.hungrycats.org Git - linux/commitdiff
net: tipc: fix information leak to userland
authorKulikov Vasiliy <segooon@gmail.com>
Sun, 31 Oct 2010 07:10:32 +0000 (07:10 +0000)
committerAndi Kleen <ak@linux.intel.com>
Thu, 28 Apr 2011 15:21:01 +0000 (08:21 -0700)
commit 88f8a5e3e7defccd3925cabb1ee4d3994e5cdb52 upstream.

Structure sockaddr_tipc is copied to userland with padding bytes after
"id" field in union field "name" unitialized.  It leads to leaking of
contents of kernel stack memory.  We have to initialize them to zero.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Moritz Muehlenhoff <jmm@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/tipc/socket.c

index 66e889ba48fd4d61088bd6e3f5e0721d7348d20b..1a5f62ab62e78ddacf38cfdde963bb5d29e98a90 100644 (file)
@@ -395,6 +395,7 @@ static int get_name(struct socket *sock, struct sockaddr *uaddr,
        struct sockaddr_tipc *addr = (struct sockaddr_tipc *)uaddr;
        struct tipc_sock *tsock = tipc_sk(sock->sk);
 
+       memset(addr, 0, sizeof(*addr));
        if (peer) {
                if ((sock->state != SS_CONNECTED) &&
                        ((peer != 2) || (sock->state != SS_DISCONNECTING)))