netrom: Fix nr_getname() leak
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>
This commit is contained in:
parent
80922bbb12
commit
f6b97b2951
1 changed files with 1 additions and 0 deletions
|
@ -847,6 +847,7 @@ static int nr_getname(struct socket *sock, struct sockaddr *uaddr,
|
||||||
sax->fsa_ax25.sax25_family = AF_NETROM;
|
sax->fsa_ax25.sax25_family = AF_NETROM;
|
||||||
sax->fsa_ax25.sax25_ndigis = 1;
|
sax->fsa_ax25.sax25_ndigis = 1;
|
||||||
sax->fsa_ax25.sax25_call = nr->user_addr;
|
sax->fsa_ax25.sax25_call = nr->user_addr;
|
||||||
|
memset(sax->fsa_digipeater, 0, sizeof(sax->fsa_digipeater));
|
||||||
sax->fsa_digipeater[0] = nr->dest_addr;
|
sax->fsa_digipeater[0] = nr->dest_addr;
|
||||||
*uaddr_len = sizeof(struct full_sockaddr_ax25);
|
*uaddr_len = sizeof(struct full_sockaddr_ax25);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue