rose: Fix rose_getname() leak
authorEric Dumazet <eric.dumazet@gmail.com>
Thu, 6 Aug 2009 03:34:06 +0000 (03:34 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 6 Aug 2009 20:08:38 +0000 (13:08 -0700)
rose_getname() can leak kernel memory to user.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rose/af_rose.c

index f0a76f6bca711a064f4611a592c82eeca9968f0f..e5f478ca3d61574e01bc74bad58cfdc910a33b4a 100644 (file)
@@ -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;