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

Commit 5233252f authored by David S. Miller's avatar David S. Miller
Browse files

bluetooth: Validate socket address length in sco_sock_bind().

parent 225734de
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -526,6 +526,9 @@ static int sco_sock_bind(struct socket *sock, struct sockaddr *addr,
	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) {