All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/3] net: tipc: fix information leak to userland
@ 2010-10-31 17:10 ` Vasiliy Kulikov
  0 siblings, 0 replies; 11+ messages in thread
From: Vasiliy Kulikov @ 2010-10-31 17:10 UTC (permalink / raw)
  To: kernel-janitors
  Cc: Jon Maloy, Allan Stephens, David S. Miller, tipc-discussion,
	netdev, linux-kernel

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>
---
 net/tipc/socket.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 33217fc..e9f0d50 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)))
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-11-10 15:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-31 17:10 [PATCH 3/3] net: tipc: fix information leak to userland Vasiliy Kulikov
2010-10-31 17:10 ` Vasiliy Kulikov
2010-11-09 17:26 ` David Miller
2010-11-09 17:26   ` David Miller
2010-11-09 17:26   ` David Miller
2010-11-09 20:33   ` Vasiliy Kulikov
2010-11-09 20:33     ` Vasiliy Kulikov
2010-11-10 11:58     ` walter harms
2010-11-10 11:58       ` walter harms
2010-11-10 15:54       ` Vasiliy Kulikov
2010-11-10 15:54         ` Vasiliy Kulikov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.