summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKulikov Vasiliy <segooon@gmail.com>2010-10-31 08:10:32 +0100
committerDavid S. Miller <davem@davemloft.net>2010-11-09 18:25:46 +0100
commit88f8a5e3e7defccd3925cabb1ee4d3994e5cdb52 (patch)
tree151d98558e8a210434e84d1e8127d681e975e80b /net
parentr8169: fix sleeping while holding spinlock. (diff)
downloadlinux-88f8a5e3e7defccd3925cabb1ee4d3994e5cdb52.tar.xz
linux-88f8a5e3e7defccd3925cabb1ee4d3994e5cdb52.zip
net: tipc: fix information leak to userland
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>
Diffstat (limited to 'net')
-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 33217fc3d697..e9f0d5004483 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -396,6 +396,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)))