mirror of https://gitee.com/openkylin/linux.git
rose: Fix rose_getname() leak
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>
This commit is contained in:
parent
b4adbb4ddf
commit
17ac2e9c58
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue