aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKulikov Vasiliy <segooon@gmail.com>2010-10-31 07:10:32 +0000
committerGreg Kroah-Hartman <gregkh@suse.de>2011-04-14 16:53:13 -0700
commit51d7a20fca5f8e96646e51bf9645da08f14e7a22 (patch)
tree59d44089bc55984b3f2e728e6a13f55b9ef27cb3
parentffaa6c6835a274584a639b5fe0825f0ea933a697 (diff)
downloadlinux-linaro-stable-51d7a20fca5f8e96646e51bf9645da08f14e7a22.tar.gz
net: tipc: fix information leak to userland
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> Cc: Moritz Muehlenhoff <jmm@debian.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--net/tipc/socket.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 4b235fc1c70f..c7344c3608a8 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -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)))