Skip to contentSkip to conversation

rose: Fix rose_getname() leak

PATCH Applied Eric Dumazet 2 participants 2 messages Aug 6, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rose: Fix rose_getname() leak

rose_getname() can leak kernel memory to user.

---

net/rose/af_rose.c +1 -0
index f0a76f6..e5f478c 100644
@@ -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;