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

Commit 56619856 authored by David S. Miller's avatar David S. Miller Committed by Sasha Levin
Browse files

bluetooth: Validate socket address length in sco_sock_bind().



[ Upstream commit 5233252fce714053f0151680933571a2da9cbfb4 ]

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
parent 652ed6f6
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -520,6 +520,9 @@ static int sco_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_le
	if (!addr || addr->sa_family != AF_BLUETOOTH)
		return -EINVAL;

	if (addr_len < sizeof(struct sockaddr_sco))
		return -EINVAL;

	lock_sock(sk);

	if (sk->sk_state != BT_OPEN) {