Skip to content

Commit

Permalink
rose: Fix rose_getname() leak
Browse files Browse the repository at this point in the history
commit 17ac2e9 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Eric Dumazet authored and Greg Kroah-Hartman committed Sep 9, 2009
1 parent 88b694d commit 6966703
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/rose/af_rose.c
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,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;
Expand Down

0 comments on commit 6966703

Please sign in to comment.