Subject: [PATCH] rose: Fix rose_getname() leak

From: Eric Dumazet <[email-masked]>
Date: Thu, 06 Aug 2009 15:34:06 +0200

rose_getname() can leak kernel memory to user.

Signed-off-by: Eric Dumazet <[email-masked]>
---
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index f0a76f6..e5f478c 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -954,6 +954,7 @@ static int rose_getname(struct socket *sock, struct sockaddr *uaddr,
 	struct rose_sock *rose = rose_sk(sk);
 	int n;
 
+	memset(srose, 0, sizeof(*srose));
 	if (peer != 0) {
 		if (sk->sk_state != TCP_ESTABLISHED)
 			return -ENOTCONN;