summaryrefslogtreecommitdiff
path: root/net/tipc
diff options
context:
space:
mode:
authorKulikov Vasiliy <segooon@gmail.com>2010-10-31 07:10:32 +0000
committerDavid S. Miller <davem@davemloft.net>2010-11-09 09:25:46 -0800
commit88f8a5e3e7defccd3925cabb1ee4d3994e5cdb52 (patch)
tree151d98558e8a210434e84d1e8127d681e975e80b /net/tipc
parentea80907ff066edd1dd43c5fe90ae6677d15e6384 (diff)
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/tipc')
-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)))