Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 09384dfc authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

irda: Fix irda_getname() leak



irda_getname() can leak kernel memory to user.

Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3d392475
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -714,6 +714,7 @@ static int irda_getname(struct socket *sock, struct sockaddr *uaddr,
	struct sock *sk = sock->sk;
	struct irda_sock *self = irda_sk(sk);

	memset(&saddr, 0, sizeof(saddr));
	if (peer) {
		if (sk->sk_state != TCP_ESTABLISHED)
			return -ENOTCONN;