]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
netrom: Fix nr_getname() leak
authorEric Dumazet <eric.dumazet@gmail.com>
Thu, 6 Aug 2009 03:31:07 +0000 (03:31 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 9 Sep 2009 03:34:09 +0000 (20:34 -0700)
commit f6b97b29513950bfbf621a83d85b6f86b39ec8db upstream.

nr_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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/netrom/af_netrom.c

index 3be0e016ab7df1bd34576816c1ea97232c36c7e8..0c3e7551dbb72c4633f61f10bbddf4c1936458cc 100644 (file)
@@ -848,6 +848,7 @@ static int nr_getname(struct socket *sock, struct sockaddr *uaddr,
                sax->fsa_ax25.sax25_family = AF_NETROM;
                sax->fsa_ax25.sax25_ndigis = 1;
                sax->fsa_ax25.sax25_call   = nr->user_addr;
+               memset(sax->fsa_digipeater, 0, sizeof(sax->fsa_digipeater));
                sax->fsa_digipeater[0]     = nr->dest_addr;
                *uaddr_len = sizeof(struct full_sockaddr_ax25);
        } else {